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
← All changes | includes/admin/settings/wppm_set_ap_grid_view.php +56 -56 6.0.46.0.6 View file →
@@ -1,57 +1,57 @@
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_grid_view', '_ajax_nonce', false ) != 1 ) {
13 - wp_send_json_error( 'Unauthorised request!', 401 );
14 -}
15 -
16 -$grid_background_color = isset( $_POST['grid-background-color'] ) ? sanitize_text_field( wp_unslash( $_POST['grid-background-color'] ) ) : '';
17 -if ( ! $grid_background_color ) {
18 - wp_send_json_error( 'Bad request', 400 );
19 -}
20 -
21 -$grid_header_text_color = isset( $_POST['grid-header-text-color'] ) ? sanitize_text_field( wp_unslash( $_POST['grid-header-text-color'] ) ) : '';
22 -if ( ! $grid_header_text_color ) {
23 - wp_send_json_error( 'Bad request', 400 );
24 -}
25 -
26 -$menu_button_bg_color = isset( $_POST['menu-button-bg-color'] ) ? sanitize_text_field( wp_unslash( $_POST['menu-button-bg-color'] ) ) : '';
27 -if ( ! $menu_button_bg_color ) {
28 - wp_send_json_error( 'Bad request', 400 );
29 -}
30 -
31 -$menu_button_hover_color = isset( $_POST['menu-button-hover-color'] ) ? sanitize_text_field( wp_unslash( $_POST['menu-button-hover-color'] ) ) : '';
32 -if ( ! $menu_button_hover_color ) {
33 - wp_send_json_error( 'Bad request', 400 );
34 -}
35 -
36 -$menu_button_text_color = isset( $_POST['menu-button-text-color'] ) ? sanitize_text_field( wp_unslash( $_POST['menu-button-text-color'] ) ) : '';
37 -if ( ! $menu_button_text_color ) {
38 - wp_send_json_error( 'Bad request', 400 );
39 -}
40 -
41 -update_option(
42 - 'wppm-ap-grid-view',
43 - array(
44 - 'grid-background-color' => $grid_background_color,
45 - 'grid-header-text-color' => $grid_header_text_color ,
46 - 'menu-button-bg-color' => $menu_button_bg_color,
47 - 'menu-button-hover-color'=> $menu_button_hover_color,
48 - 'menu-button-text-color' => $menu_button_text_color
49 - )
50 -);
51 -do_action('wppm_set_ap_grid_view_setting');
52 -
53 -echo wp_json_encode( array(
54 - 'sucess_status' => 1,
55 - 'messege' => esc_html__( 'Settings saved.', 'taskbuilder' ),
56 -) );
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_grid_view', '_ajax_nonce', false ) != 1 ) {
13 + wp_send_json_error( 'Unauthorised request!', 401 );
14 +}
15 +
16 +$grid_background_color = isset( $_POST['grid-background-color'] ) ? sanitize_text_field( wp_unslash( $_POST['grid-background-color'] ) ) : '';
17 +if ( ! $grid_background_color ) {
18 + wp_send_json_error( 'Bad request', 400 );
19 +}
20 +
21 +$grid_header_text_color = isset( $_POST['grid-header-text-color'] ) ? sanitize_text_field( wp_unslash( $_POST['grid-header-text-color'] ) ) : '';
22 +if ( ! $grid_header_text_color ) {
23 + wp_send_json_error( 'Bad request', 400 );
24 +}
25 +
26 +$menu_button_bg_color = isset( $_POST['menu-button-bg-color'] ) ? sanitize_text_field( wp_unslash( $_POST['menu-button-bg-color'] ) ) : '';
27 +if ( ! $menu_button_bg_color ) {
28 + wp_send_json_error( 'Bad request', 400 );
29 +}
30 +
31 +$menu_button_hover_color = isset( $_POST['menu-button-hover-color'] ) ? sanitize_text_field( wp_unslash( $_POST['menu-button-hover-color'] ) ) : '';
32 +if ( ! $menu_button_hover_color ) {
33 + wp_send_json_error( 'Bad request', 400 );
34 +}
35 +
36 +$menu_button_text_color = isset( $_POST['menu-button-text-color'] ) ? sanitize_text_field( wp_unslash( $_POST['menu-button-text-color'] ) ) : '';
37 +if ( ! $menu_button_text_color ) {
38 + wp_send_json_error( 'Bad request', 400 );
39 +}
40 +
41 +update_option(
42 + 'wppm-ap-grid-view',
43 + array(
44 + 'grid-background-color' => $grid_background_color,
45 + 'grid-header-text-color' => $grid_header_text_color ,
46 + 'menu-button-bg-color' => $menu_button_bg_color,
47 + 'menu-button-hover-color'=> $menu_button_hover_color,
48 + 'menu-button-text-color' => $menu_button_text_color
49 + )
50 +);
51 +do_action('wppm_set_ap_grid_view_setting');
52 +
53 +echo wp_json_encode( array(
54 + 'sucess_status' => 1,
55 + 'messege' => esc_html__( 'Settings saved.', 'taskbuilder' ),
56 +) );
57 57 wp_die();