| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; // Exit if accessed directly |
| 4 |
} |
| 5 |
|
| 6 |
global $current_user, $wpdb,$wppmfunction; |
| 7 |
if (!($current_user->ID && $current_user->has_cap('manage_options') || ($current_user->ID && $current_user->has_cap('wppm_admin')))) {exit;} |
| 8 |
if ( check_ajax_referer( 'wppm_set_print_task_settings', '_ajax_nonce', false ) != 1 ) { |
| 9 |
wp_send_json_error( 'Unauthorised request!', 401 ); |
| 10 |
} |
| 11 |
$wppm_font_size = isset($_POST) && isset($_POST['wppm_print_body_font_size']) ? absint(sanitize_text_field(wp_unslash($_POST['wppm_print_body_font_size']))) : '10'; |
| 12 |
$wppm_print_settings = array( |
| 13 |
'wppm_print_body_font_size' => $wppm_font_size |
| 14 |
); |
| 15 |
update_option('wppm_print_settings',$wppm_print_settings); |
| 16 |
echo wp_json_encode( array( |
| 17 |
'sucess_status' => 1, |
| 18 |
'messege' => esc_html__( 'Print settings saved.', 'taskbuilder' ), |
| 19 |
) ); |
| 20 |
wp_die(); |