| @@ -33,19 +33,5 @@ | ||
| 33 | 33 | $valid = $this->permission_callback( $request ); |
| 34 | 34 | |
| 35 | 35 | return $valid && user_can( $this->current_user_id, 'manage_options' ); |
| 36 | 36 | } |
| 37 | - | |
| 38 | - public function verify_nonce( $nonce = '', $name = '' ) { | |
| 39 | - if ( ! wp_verify_nonce( sanitize_text_field( wp_unslash( $nonce ) ), $name ) ) { | |
| 40 | - wp_die( 'Invalid nonce', 'image-optimization' ); | |
| 41 | - } | |
| 42 | - } | |
| 43 | - | |
| 44 | - public function verify_nonce_and_capability( $nonce = '', $name = '', $capability = 'manage_options' ) { | |
| 45 | - $this->verify_nonce( $nonce, $name ); | |
| 46 | - | |
| 47 | - if ( ! current_user_can( $capability ) ) { | |
| 48 | - wp_die( 'You do not have sufficient permissions to access this page.' ); | |
| 49 | - } | |
| 50 | - } | |
| 51 | 37 | } |