| 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'))) { |
| 8 |
exit; |
| 9 |
} |
| 10 |
|
| 11 |
// From Name |
| 12 |
$from_name = isset($_POST) && isset($_POST['wppm_en_from_name']) ? sanitize_text_field($_POST['wppm_en_from_name']) : ''; |
| 13 |
update_option('wppm_en_from_name',$from_name); |
| 14 |
|
| 15 |
// From Email |
| 16 |
$from_email = isset($_POST) && isset($_POST['wppm_en_from_email']) ? sanitize_text_field($_POST['wppm_en_from_email']) : ''; |
| 17 |
update_option('wppm_en_from_email',$from_email); |
| 18 |
|
| 19 |
// Block emails |
| 20 |
$ignore_emails = isset($_POST) && isset($_POST['wppm_en_ignore_emails']) ? explode("\n", ($_POST['wppm_en_ignore_emails'])) : array(); |
| 21 |
$ignore_emails = $wppmfunction->sanitize_array($ignore_emails); |
| 22 |
update_option('wppm_en_ignore_emails',$ignore_emails); |
| 23 |
|
| 24 |
do_action('wppm_set_en_gerneral_settings'); |
| 25 |
|
| 26 |
echo '{ "sucess_status":"1","messege":"'.__('Settings saved.','taskbuilder').'" }'; |
| 27 |
|