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_ap_individual_proj.php

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

108 lines 4.8 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,$wppmfunction;
7
8 if (!($current_user->ID && $current_user->has_cap('manage_options') || ($current_user->ID && $current_user->has_cap('wppm_admin')))) {
9 exit;
10 }
11
12 if ( check_ajax_referer( 'wppm_set_ap_individual_proj', '_ajax_nonce', false ) != 1 ) {
13 wp_send_json_error( 'Unauthorised request!', 401 );
14 }
15
16 $menu_button_bg_color = isset( $_POST['menu-button-bg-color'] ) ? sanitize_text_field( wp_unslash( $_POST['menu-button-bg-color'] ) ) : '';
17 if ( ! $menu_button_bg_color ) {
18 wp_send_json_error( 'Bad request', 400 );
19 }
20 $menu_button_hover_color = isset( $_POST['menu-button-hover-color'] ) ? sanitize_text_field( wp_unslash( $_POST['menu-button-hover-color'] ) ) : '';
21 if ( ! $menu_button_hover_color ) {
22 wp_send_json_error( 'Bad request', 400 );
23 }
24 $menu_button_text_color = isset( $_POST['menu-button-text-color'] ) ? sanitize_text_field( wp_unslash( $_POST['menu-button-text-color'] ) ) : '';
25 if ( ! $menu_button_text_color ) {
26 wp_send_json_error( 'Bad request', 400 );
27 }
28 $comment_primary_color = isset( $_POST['comment-primary-color'] ) ? sanitize_text_field( wp_unslash( $_POST['comment-primary-color'] ) ) : '';
29 if ( ! $comment_primary_color ) {
30 wp_send_json_error( 'Bad request', 400 );
31 }
32
33 $comment_secondary_color = isset( $_POST['comment-secondary-color'] ) ? sanitize_text_field( wp_unslash( $_POST['comment-secondary-color'] ) ) : '';
34 if ( ! $comment_secondary_color ) {
35 wp_send_json_error( 'Bad request', 400 );
36 }
37
38 $comment_date_color = isset( $_POST['comment-date-color'] ) ? sanitize_text_field( wp_unslash( $_POST['comment-date-color'] ) ) : '';
39 if ( ! $comment_date_color ) {
40 wp_send_json_error( 'Bad request', 400 );
41 }
42
43 $comment_date_hover_color = isset( $_POST['comment-date-hover-color'] ) ? sanitize_text_field( wp_unslash( $_POST['comment-date-hover-color'] ) ) : '';
44 if ( ! $comment_date_hover_color ) {
45 wp_send_json_error( 'Bad request', 400 );
46 }
47
48 $comment_send_btn_bg_color = isset( $_POST['comment-send-btn-bg-color']) ? sanitize_text_field( wp_unslash( $_POST['comment-send-btn-bg-color'] ) ) : '';
49 if ( ! $comment_send_btn_bg_color ) {
50 wp_send_json_error( 'Bad request', 400 );
51 }
52
53 $comment_send_btn_color = isset( $_POST['comment-send-btn-color']) ? sanitize_text_field( wp_unslash( $_POST['comment-send-btn-color'] ) ) : '';
54 if ( ! $comment_send_btn_color ) {
55 wp_send_json_error( 'Bad request', 400 );
56 }
57
58 $widget_header_bg_color = isset( $_POST['widget-header-bg-color'] ) ? sanitize_text_field( wp_unslash( $_POST['widget-header-bg-color'] ) ) : '';
59 if ( ! $widget_header_bg_color ) {
60 wp_send_json_error( 'Bad request', 400 );
61 }
62
63 $widget_header_text_color = isset( $_POST['widget-header-text-color'] ) ? sanitize_text_field( wp_unslash( $_POST['widget-header-text-color'] ) ) : '';
64 if ( ! $widget_header_text_color ) {
65 wp_send_json_error( 'Bad request', 400 );
66 }
67
68 $widget_body_bg_color = isset( $_POST['widget-body-bg-color'] ) ? sanitize_text_field( wp_unslash( $_POST['widget-body-bg-color'] ) ) : '';
69 if ( ! $widget_body_bg_color ) {
70 wp_send_json_error( 'Bad request', 400 );
71 }
72
73 $widget_body_label_color = isset( $_POST['widget-body-label-color'] ) ? sanitize_text_field( wp_unslash( $_POST['widget-body-label-color'] ) ) : '';
74 if ( ! $widget_body_label_color ) {
75 wp_send_json_error( 'Bad request', 400 );
76 }
77
78 $widget_body_text_color = isset( $_POST['widget-body-text-color'] ) ? sanitize_text_field( wp_unslash( $_POST['widget-body-text-color'] ) ) : '';
79 if ( ! $widget_body_text_color ) {
80 wp_send_json_error( 'Bad request', 400 );
81 }
82
83 update_option(
84 'wppm-ap-individual-project',
85 array(
86 'menu-button-bg-color' => $menu_button_bg_color,
87 'menu-button-hover-color' => $menu_button_hover_color,
88 'menu-button-text-color' => $menu_button_text_color,
89 'comment-primary-color' => $comment_primary_color,
90 'comment-secondary-color' => $comment_secondary_color,
91 'comment-date-color' => $comment_date_color,
92 'comment-date-hover-color' => $comment_date_hover_color,
93 'comment-send-btn-bg-color' => $comment_send_btn_bg_color,
94 'comment-send-btn-color' => $comment_send_btn_color,
95 'widget-header-bg-color' => $widget_header_bg_color,
96 'widget-header-text-color' => $widget_header_text_color,
97 'widget-body-bg-color' => $widget_body_bg_color,
98 'widget-body-label-color' => $widget_body_label_color,
99 'widget-body-text-color' => $widget_body_text_color
100 )
101 );
102 do_action('wppm_set_ap_individual_proj_settings');
103
104 echo wp_json_encode( array(
105 'sucess_status' => 1,
106 'messege' => esc_html__( 'Settings saved.', 'taskbuilder' ),
107 ) );
108 wp_die();