get_task($subtask_id); if (empty($subtask) || empty($subtask['parent_task_id'])) {exit;} $project_data = $wppmfunction->get_project($subtask['project']); $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',$subtask_id) || $wppm_current_user_capability == 'wppm_admin' || $project_data['created_by']==$current_user->ID)) { exit; } WPPM_Functions::delete_task_and_children($subtask_id);