PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 2.12.0
GiveWP – Donation Plugin and Fundraising Platform v2.12.0
4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 All 254 releases
give / includes / admin / emails / ajax-handler.php

ajax-handler.php in GiveWP – Donation Plugin and Fundraising Platform 2.12.0, at includes/admin/emails/ajax-handler.php

33 lines 986 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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