PluginProbe
Taskbuilder – Project Management & Task Management Tool With Kanban Board / 2.0.2
Taskbuilder – Project Management & Task Management Tool With Kanban Board v2.0.2
6.0.5 6.0.2 6.0.3 6.0.4 6.0.1 6.0.0 5.0.8 5.0.9 4.0.9 5.0.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 All 57 releases
taskbuilder / includes / admin / tasks / wppm_create_task.php

wppm_create_task.php in Taskbuilder – Project Management & Task Management Tool With Kanban Board 2.0.2, at includes/admin/tasks/wppm_create_task.php

41 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1
2 <?php
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit; // Exit if accessed directly
5 }
6 global $current_user,$wpdb,$wppmfunction;
7
8 // Task name
9 $name = isset($_POST['name']) ? sanitize_text_field($_POST['name']) : '';
10 if($name) $args['name'] = $name;
11
12 // Description
13 $allowedtags = array( 'br' => array(), 'abbr' => array('title' => array(),), 'p' => array(), 'strong' => array(), 'a' => array('href' => array(), 'title' => array(),'target'=> array(), 'rel'=>array()),'em' =>array(),'span' =>array(), 'blockquote'=>array('cite' => array(),),'div' => array('class' => array(),'title' => array(),'style' => array(),),'ul'=>array(),'li'=>array(),'ol'=>array(),'img' => array( 'alt'=> array(),'class' => array(),'height' => array(),'src'=> array(),'width'=> array(),));
14 $task_description = isset($_POST['wppm_task_description']) ? wp_kses(htmlspecialchars_decode($_POST['wppm_task_description'], ENT_QUOTES),$allowedtags) : '';
15 if($task_description) $args['wppm_task_description'] = $task_description;
16
17 //project
18 $wppm_task_project = isset($_POST['wppm_task_project']) ? intval(sanitize_text_field($_POST['wppm_task_project'])) : '';
19 if($wppm_task_project) $args['wppm_task_project'] = $wppm_task_project;
20
21 //Task start date
22 $text = isset($_POST['wppm_task_start_date']) ? sanitize_text_field($_POST['wppm_task_start_date']) : '';
23 if($text) $args['wppm_task_start_date'] = date("Y-m-d H:i:s" ,strtotime($text));
24
25 //Task end date
26 $text2 = isset($_POST['wppm_task_end_date']) ? sanitize_text_field($_POST['wppm_task_end_date']) : '';
27 if($text2) $args['wppm_task_end_date'] = date("Y-m-d H:i:s" ,strtotime($text2));
28
29 // Priority
30 $task_priority = isset($_POST['wppm_create_task_priority']) ? intval(sanitize_text_field($_POST['wppm_create_task_priority'])) : '';
31 if($task_priority) $args['wppm_create_task_priority'] = $task_priority;
32
33 //Assign user
34 $arrVal = isset($_POST['user_names']) ? array_unique($_POST['user_names']) : array();
35 if($arrVal) $args['user_names'] = $wppmfunction->sanitize_array($arrVal);
36
37 $args = apply_filters( 'wppm_before_create_task_args', $args);
38
39 $task_id = WPPM_Functions::create_task($args);
40 do_action('wppm_after_task_created', $task_id);
41