# taskbuilder/6.0.6/includes/admin/tasks/wppm_get_delete_task.php

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

- Page: https://pluginprobe.com/plugins/taskbuilder/6.0.6/code/includes/admin/tasks/wppm_get_delete_task.php
- Raw: https://pluginprobe.com/plugins/taskbuilder/6.0.6/raw/includes/admin/tasks/wppm_get_delete_task.php
- Modified: 2026-08-26T12:08:58+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/6.0.6/code/includes/admin/tasks/wppm_get_delete_task.php#L10-L20`.

```php
<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}

global $current_user,$wppmfunction;
$id = isset($_POST['id']) ? sanitize_text_field(wp_unslash($_POST['id'])) : '';
$proj_id = isset($_POST['proj_id']) ? sanitize_text_field(wp_unslash($_POST['proj_id'])) : '';
$project_id = isset($_POST['project_id']) ? sanitize_text_field(wp_unslash($_POST['project_id'])) : '';
$task_data = $wppmfunction->get_task($id);
$project_data = $wppmfunction->get_project($proj_id);
$wppm_current_user_capability = get_user_meta( $current_user->ID, 'wppm_capability', true );
if(!(($current_user->ID && $current_user->has_cap('manage_options')) || ($wppmfunction->has_permission('delete_task',$id)) || $wppm_current_user_capability == 'wppm_admin'|| $project_data['created_by']==$current_user->ID )){
    exit;
}
ob_start();
?>
<form id="frm_delete_task">
    <div class="form-group">
        <p><?php echo esc_html_e('Are you sure to delete this task?','taskbuilder');?></p>
    </div>
    <input type="hidden" name="action" value="wppm_set_delete_task" />
    <input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr(wp_create_nonce('wppm_set_delete_task'))?>">
    <input type="hidden" name="task_id" value="<?php echo (esc_attr($id))?>" />
</form>
<?php
$body = ob_get_clean();
ob_start();
?>
<button type="button" class="btn <?php echo (($proj_id!="0"))?'wppm_popup_close':'wppm_task_popup_close'?>"  onclick="<?php echo (($proj_id!=0))?'wppm_modal_close();':'wppm_task_modal_close();'?>"><?php echo esc_html_e('Cancel','taskbuilder');?></button>
<button type="button" class="btn <?php echo ($proj_id!="0")?'wppm_popup_action':'wppm_task_popup_action'?>" onclick="wppm_set_delete_task(<?php echo esc_attr($proj_id) ?>, <?php echo esc_attr($project_id) ?>);"><?php echo esc_html_e('Confirm','taskbuilder');?></button>
<?php
$footer = ob_get_clean();
$response = array(
    'body'      => $body,
    'footer'    => $footer
);
echo wp_json_encode($response);

```
