← All changes
|
includes/admin/settings/wppm_delete_task_status.php
+15
-15
6.0.3
→
6.0.6
View file →
| @@ -1,15 +1,15 @@ | ||
| 1 | -<?php | |
| 2 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 3 | - exit; // Exit if accessed directly | |
| 4 | -} | |
| 5 | - | |
| 6 | -global $current_user,$wpdb; | |
| 7 | -if (!($current_user->ID && $current_user->has_cap('manage_options') || ($current_user->ID && $current_user->has_cap('wppm_admin')))) {exit;} | |
| 8 | -if ( check_ajax_referer( 'wppm_delete_task_status', '_ajax_nonce', false ) != 1 ) { | |
| 9 | - wp_send_json_error( 'Unauthorised request!', 401 ); | |
| 10 | -} | |
| 11 | - | |
| 12 | -$status_id = isset($_POST) && isset($_POST['status_id']) ? absint(sanitize_text_field(wp_unslash($_POST['status_id']))) : 0; | |
| 13 | -if (!$status_id) {exit;} | |
| 14 | - | |
| 15 | -$wpdb->delete($wpdb->prefix.'wppm_task_statuses', array( 'id' => absint($status_id))); | |
| 1 | +<?php | |
| 2 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 3 | + exit; // Exit if accessed directly | |
| 4 | +} | |
| 5 | + | |
| 6 | +global $current_user,$wpdb; | |
| 7 | +if (!($current_user->ID && $current_user->has_cap('manage_options') || ($current_user->ID && $current_user->has_cap('wppm_admin')))) {exit;} | |
| 8 | +if ( check_ajax_referer( 'wppm_delete_task_status', '_ajax_nonce', false ) != 1 ) { | |
| 9 | + wp_send_json_error( 'Unauthorised request!', 401 ); | |
| 10 | +} | |
| 11 | + | |
| 12 | +$status_id = isset($_POST) && isset($_POST['status_id']) ? absint(sanitize_text_field(wp_unslash($_POST['status_id']))) : 0; | |
| 13 | +if (!$status_id) {exit;} | |
| 14 | + | |
| 15 | +$wpdb->delete($wpdb->prefix.'wppm_task_statuses', array( 'id' => absint($status_id))); | |