| @@ -26,12 +26,16 @@ | ||
| 26 | 26 | return [ 'DELETE' ]; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | public function DELETE( WP_REST_Request $request ) { |
| 30 | - $this->verify_nonce_and_capability( | |
| 30 | + $error = $this->verify_nonce_and_capability( | |
| 31 | 31 | $request->get_param( self::NONCE_NAME ), |
| 32 | 32 | self::NONCE_NAME |
| 33 | 33 | ); |
| 34 | + | |
| 35 | + if ( $error ) { | |
| 36 | + return $error; | |
| 37 | + } | |
| 34 | 38 | |
| 35 | 39 | try { |
| 36 | 40 | Remove_All_Backups::find_and_schedule_removing(); |
| 37 | 41 | |