# taskbuilder/4.0.2/includes/admin/settings/wppm_delete_task_priority.php

Taskbuilder – Project Management &amp; Task Management Tool With Kanban Board, version 4.0.2. 17 lines.

- Page: https://pluginprobe.com/plugins/taskbuilder/4.0.2/code/includes/admin/settings/wppm_delete_task_priority.php
- Raw: https://pluginprobe.com/plugins/taskbuilder/4.0.2/raw/includes/admin/settings/wppm_delete_task_priority.php
- Modified: 2024-12-19T12:34:10+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/taskbuilder/4.0.2/code/includes/admin/settings/wppm_delete_task_priority.php#L10-L20`.

```php
<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}

global $current_user,$wpdb;
if (!($current_user->ID && $current_user->has_cap('manage_options') || ($current_user->ID && $current_user->has_cap('wppm_admin')))) {exit;}
if ( check_ajax_referer( 'wppm_delete_task_priority', '_ajax_nonce', false ) != 1 ) {
    wp_send_json_error( 'Unauthorised request!', 401 );
}

$priority_id = isset($_POST) && isset($_POST['priority_id']) ? intval(sanitize_text_field($_POST['priority_id'])) : 0;
if (!$priority_id) {exit;}
$priority_id = esc_sql($priority_id);

$wpdb->delete($wpdb->prefix.'wppm_task_priorities', array( 'id' => "$priority_id"));

```
