abstract-email-notification.php
4 years ago
ajax-handler.php
6 years ago
backward-compatibility.php
6 years ago
class-donation-receipt-email.php
4 years ago
class-donor-note-email.php
6 years ago
class-donor-register-email.php
3 years ago
class-email-access-email.php
6 years ago
class-email-notification-table.php
6 years ago
class-email-notification-util.php
6 years ago
class-email-notifications.php
4 years ago
class-email-setting-field.php
4 years ago
class-new-donation-email.php
6 years ago
class-new-donor-register-email.php
3 years ago
class-new-offline-donation-email.php
6 years ago
class-offline-donation-instruction-email.php
6 years ago
filters.php
3 years ago
ajax-handler.php
33 lines
| 1 | <?php |
| 2 | /** |
| 3 | * This file contain code to handle email notification setting ajax. |
| 4 | * |
| 5 | * Register settings Include and setup custom metaboxes and fields. |
| 6 | * |
| 7 | * @package Give |
| 8 | * @subpackage Classes/Emails |
| 9 | * @license https://opensource.org/licenses/gpl-license GNU Public License |
| 10 | * @link https://github.com/webdevstudios/Custom-Metaboxes-and-Fields-for-WordPress |
| 11 | */ |
| 12 | |
| 13 | /** |
| 14 | * Enabled & disable notification |
| 15 | * |
| 16 | * @since 2.0 |
| 17 | */ |
| 18 | function give_set_notification_status_handler() { |
| 19 | // Is user have permission to edit give setting. |
| 20 | if ( ! current_user_can( 'manage_give_settings' ) ) { |
| 21 | return; |
| 22 | } |
| 23 | |
| 24 | $notification_id = isset( $_POST['notification_id'] ) ? give_clean( $_POST['notification_id'] ) : ''; |
| 25 | if ( ! empty( $notification_id ) && give_update_option( "{$notification_id}_notification", give_clean( $_POST['status'] ) ) ) { |
| 26 | wp_send_json_success(); |
| 27 | } |
| 28 | |
| 29 | wp_send_json_error(); |
| 30 | } |
| 31 | |
| 32 | add_action( 'wp_ajax_give_set_notification_status', 'give_set_notification_status_handler' ); |
| 33 |