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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,8 +17,8 @@ class Setup {
|
||||
} catch(Exception $e) {
|
||||
$result = false;
|
||||
}
|
||||
wp_send_json(array(
|
||||
return array(
|
||||
'result' => $result
|
||||
));
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user