Router update for Settings and Setup + unit tests

This commit is contained in:
Jonathan Labreuille
2016-01-29 18:46:12 +01:00
parent b577d33414
commit d4623cf763
4 changed files with 77 additions and 5 deletions

View File

@ -10,17 +10,17 @@ class Settings {
function get() {
$settings = Setting::getAll();
wp_send_json($settings);
return $settings;
}
function set($settings = array()) {
if(empty($settings)) {
wp_send_json(false);
return false;
} else {
foreach($settings as $name => $value) {
Setting::setValue($name, $value);
}
wp_send_json(true);
return true;
}
}
}