| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; // Exit if accessed directly |
| 4 |
} |
| 5 |
|
| 6 |
global $current_user,$wppmfunction; |
| 7 |
if (!($current_user->ID && $current_user->has_cap('manage_options') || ($current_user->ID && $current_user->has_cap('wppm_admin')))) { |
| 8 |
exit; |
| 9 |
} |
| 10 |
if ( check_ajax_referer( 'wppm_set_page_settings', '_ajax_nonce', false ) != 1 ) { |
| 11 |
wp_send_json_error( 'Unauthorised request!', 401 ); |
| 12 |
} |
| 13 |
|
| 14 |
$page_settings = apply_filters( |
| 15 |
'wppm_set_page_settings', |
| 16 |
array( |
| 17 |
'task-url-page' => isset( $_POST['task-url-page'] ) ? intval( $_POST['task-url-page'] ) : 0, |
| 18 |
'project-url-page' => isset( $_POST['project-url-page'] ) ? intval( $_POST['project-url-page'] ) : 0 |
| 19 |
) |
| 20 |
); |
| 21 |
update_option( 'wppm-page-settings', $page_settings ); |
| 22 |
do_action('wppm_set_page_settings'); |
| 23 |
|
| 24 |
echo '{ "sucess_status":"1","messege":"'.__('Settings saved.','taskbuilder').'" }'; |