← All changes
|
includes/api/classes/class-api-handler-admin-debugging.php
+5
-5
2.10.0
→
3.2.1
View file →
| @@ -41,9 +41,9 @@ | ||
| 41 | 41 | self::ENDPOINT_VERSION, |
| 42 | 42 | array( |
| 43 | 43 | 'methods' => \WP_REST_Server::EDITABLE, |
| 44 | 44 | 'callback' => array( $this, 'save_options' ), |
| 45 | - 'permission_callback' => array( $this, 'user_is_able_to_admin_force_refresh' ), | |
| 45 | + 'permission_callback' => $this->get_admin_permission_callback(), | |
| 46 | 46 | ), |
| 47 | 47 | ); |
| 48 | 48 | } |
| 49 | 49 | |
| @@ -51,17 +51,17 @@ | ||
| 51 | 51 | * Method for saving options |
| 52 | 52 | * |
| 53 | 53 | * @param \WP_REST_Request $request The WP ReST request. |
| 54 | 54 | * |
| 55 | - * @return void | |
| 55 | + * @return \WP_REST_Response | |
| 56 | 56 | */ |
| 57 | - public function save_options( \WP_REST_Request $request ): void { | |
| 57 | + public function save_options( \WP_REST_Request $request ): \WP_REST_Response { | |
| 58 | 58 | $debug_mode = $request->get_param( 'debug' ) === true ?? null; |
| 59 | 59 | |
| 60 | 60 | Debug_Storage_Service::set_debug_mode( $debug_mode ); |
| 61 | 61 | |
| 62 | - $this->return_api_response( | |
| 63 | - 201, | |
| 62 | + return $this->return_api_response( | |
| 63 | + \WP_Http::CREATED, | |
| 64 | 64 | 'You\'ve successfully updated debug mode.' |
| 65 | 65 | ); |
| 66 | 66 | } |
| 67 | 67 | |