Router update for Settings and Setup + unit tests
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user