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

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

68 lines 2.7 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_settings', '_ajax_nonce', false ) != 1 ) {
13 wp_send_json_error( 'Unauthorised request!', 401 );
14 }
15
16 $tab_background_color = isset( $_POST['tab-background-color'] ) ? sanitize_text_field( wp_unslash( $_POST['tab-background-color'] ) ) : '';
17 if ( ! $tab_background_color ) {
18 wp_send_json_error( 'Bad request', 400 );
19 }
20
21 $tab_text_color = isset( $_POST['tab-text-color'] ) ? sanitize_text_field( wp_unslash( $_POST['tab-text-color'] ) ) : '';
22 if ( ! $tab_text_color ) {
23 wp_send_json_error( 'Bad request', 400 );
24 }
25
26 $add_new_button_bg_color = isset( $_POST['add-new-button-bg-color'] ) ? sanitize_text_field( wp_unslash( $_POST['add-new-button-bg-color'] ) ) : '';
27 if ( ! $add_new_button_bg_color ) {
28 wp_send_json_error( 'Bad request', 400 );
29 }
30
31 $add_new_button_text_color = isset( $_POST['add-new-button-text-color'] ) ? sanitize_text_field( wp_unslash( $_POST['add-new-button-text-color'] ) ) : '';
32 if ( ! $add_new_button_text_color ) {
33 wp_send_json_error( 'Bad request', 400 );
34 }
35
36 $add_new_button_hover_color = isset( $_POST['add-new-button-hover-color'] ) ? sanitize_text_field( wp_unslash( $_POST['add-new-button-hover-color'] ) ) : '';
37 if ( ! $add_new_button_hover_color ) {
38 wp_send_json_error( 'Bad request', 400 );
39 }
40
41 $save_changes_button_bg_color = isset( $_POST['save-changes-button-bg-color'] ) ? sanitize_text_field( wp_unslash( $_POST['save-changes-button-bg-color'] ) ) : '';
42 if ( ! $save_changes_button_bg_color ) {
43 wp_send_json_error( 'Bad request', 400 );
44 }
45
46 $save_changes_button_text_color = isset( $_POST['save-changes-button-text-color'] ) ? sanitize_text_field( wp_unslash( $_POST['save-changes-button-text-color'] ) ) : '';
47 if ( ! $save_changes_button_text_color ) {
48 wp_send_json_error( 'Bad request', 400 );
49 }
50 update_option(
51 'wppm-ap-settings',
52 array(
53 'tab-background-color' => $tab_background_color,
54 'tab-text-color' => $tab_text_color ,
55 'add-new-button-bg-color'=>$add_new_button_bg_color,
56 'add-new-button-text-color'=>$add_new_button_text_color,
57 'add-new-button-hover-color'=>$add_new_button_hover_color,
58 'save-changes-button-bg-color'=>$save_changes_button_bg_color,
59 'save-changes-button-text-color'=>$save_changes_button_text_color
60 )
61 );
62 do_action('wppm_set_ap_settings');
63
64 echo wp_json_encode( array(
65 'sucess_status' => 1,
66 'messege' => esc_html__( 'Settings saved.', 'taskbuilder' ),
67 ) );
68 wp_die();