| @@ -94,9 +94,9 @@ | ||
| 94 | 94 | if(!current_user_can('manage_options')){ |
| 95 | 95 | return; |
| 96 | 96 | } |
| 97 | 97 | if(isset($_POST['_ajax_nonce']) && !wp_verify_nonce(sanitize_text_field( wp_unslash ( $_POST['_ajax_nonce'] ) ), 'save_options')){ |
| 98 | - wp_die(); | |
| 98 | + return wp_send_json(['error' => 'Nonce is invalid']); | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | $nonce = ( ! empty( $_POST['nonce'] ) ) ? sanitize_text_field( wp_unslash( $_POST['nonce'] ) ) : ''; |
| 102 | 102 | $unique = ( ! empty( $_POST['unique'] ) ) ? sanitize_text_field( wp_unslash( $_POST['unique'] ) ) : ''; |
| @@ -161,9 +161,9 @@ | ||
| 161 | 161 | return; |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | if(isset($_POST['_ajax_nonce']) && !wp_verify_nonce(sanitize_text_field( wp_unslash ( $_POST['_ajax_nonce'] ) ), 'save_options')){ |
| 165 | - wp_die(); | |
| 165 | + return wp_send_json(['error' => 'Nonce is invalid']); | |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | $nonce = ( ! empty( $_POST['nonce'] ) ) ? sanitize_text_field( wp_unslash( $_POST['nonce'] ) ) : ''; |
| 169 | 169 | $type = ( ! empty( $_POST['type'] ) ) ? sanitize_text_field( wp_unslash( $_POST['type'] ) ) : ''; |