PluginProbe
Taskbuilder – Project Management & Task Management Tool With Kanban Board / 6.0.6
Taskbuilder – Project Management & Task Management Tool With Kanban Board v6.0.6
6.0.6 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 All 58 releases
taskbuilder / includes / admin / settings / wppm_set_add_priority.php

wppm_set_add_priority.php in Taskbuilder – Project Management & Task Management Tool With Kanban Board 6.0.6, at includes/admin/settings/wppm_set_add_priority.php

35 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit; // Exit if accessed directly
4 }
5
6 global $current_user, $wpdb;
7 if (!($current_user->ID && $current_user->has_cap('manage_options') || ($current_user->ID && $current_user->has_cap('wppm_admin')))) {exit;}
8
9 if ( check_ajax_referer( 'wppm_set_add_priority', '_ajax_nonce', false ) != 1 ) {
10 wp_send_json_error( 'Unauthorised request!', 401 );
11 }
12
13 $priority_name = isset($_POST) && isset($_POST['priority_name']) ? sanitize_text_field(wp_unslash($_POST['priority_name'])) : '';
14 if (!$priority_name) {exit;}
15 $priority_color = isset($_POST) && isset($_POST['priority_color']) ? sanitize_text_field(wp_unslash($_POST['priority_color'])) : '';
16 if (!$priority_color) {exit;}
17 $priority_bg_color = isset($_POST) && isset($_POST['priority_bg_color']) ? sanitize_text_field(wp_unslash($_POST['priority_bg_color'])) : '';
18 if (!$priority_bg_color) {exit;}
19 if ($priority_color==$priority_bg_color) {
20 echo '{ "sucess_status":"0","messege":"'.esc_html__('Status color and background color should not be same.','taskbuilder').'" }';
21 die();
22 }
23 $load_order = $wpdb->get_var("select max(load_order) from {$wpdb->prefix}wppm_task_priorities");
24 $values=array(
25 'name'=>($priority_name),
26 'color'=>($priority_color),
27 'bg_color'=>($priority_bg_color),
28 'load_order'=> absint(++$load_order)
29 );
30 $wpdb->insert($wpdb->prefix.'wppm_task_priorities',$values);
31 echo wp_json_encode( array(
32 'sucess_status' => 1,
33 'messege' => esc_html__( 'Priority added successfully.', 'taskbuilder' ),
34 ) );
35 wp_die();