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

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

- Page: https://pluginprobe.com/plugins/taskbuilder/3.0.0/code/includes/admin/settings/wppm_delete_task_priority.php
- Raw: https://pluginprobe.com/plugins/taskbuilder/3.0.0/raw/includes/admin/settings/wppm_delete_task_priority.php
- Modified: 2024-05-01T13:10: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/3.0.0/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'))) {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;}

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

```
