true, 'msg' => 'Unauthorized Request', 'data' => [], ]); } } public function update_settings() { $this->check_nonce(); $request = $_REQUEST; unset($request['action']); unset($request['nonce']); $status = Settings::instance()->update_settings($request); $msg = $status ? 'Settings updated.' : 'Settings nothing to update/ failed.'; wp_send_json([ 'status' => $status, 'msg' => $msg, 'data' => $request, ]); } public function get_settings() { $this->check_nonce(); wp_send_json([ 'status' => true, 'msg' => 'Settings get.', 'data' => Settings::instance()->get_settings(), ]); } }