| 1 |
<?php |
| 2 |
/** |
| 3 |
* Charitable AJAX Hooks. |
| 4 |
* |
| 5 |
* Action/filter hooks used for Charitable AJAX setup. |
| 6 |
* |
| 7 |
* @package Charitable/Functions/AJAX |
| 8 |
* @author David Bisset |
| 9 |
* @copyright Copyright (c) 2023, WP Charitable LLC |
| 10 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 11 |
* @since 1.2.3 |
| 12 |
* @version 1.6.28 |
| 13 |
*/ |
| 14 |
|
| 15 |
// Exit if accessed directly. |
| 16 |
if ( ! defined( 'ABSPATH' ) ) { |
| 17 |
exit; |
| 18 |
} |
| 19 |
|
| 20 |
/** |
| 21 |
* Retrieve a campaign's donation form via AJAX. |
| 22 |
* |
| 23 |
* @see charitable_ajax_get_donation_form |
| 24 |
*/ |
| 25 |
add_action( 'wp_ajax_get_donation_form', 'charitable_ajax_get_donation_form' ); |
| 26 |
add_action( 'wp_ajax_nopriv_get_donation_form', 'charitable_ajax_get_donation_form' ); |
| 27 |
|
| 28 |
/** |
| 29 |
* Upload an image through pupload uploader. |
| 30 |
* |
| 31 |
* @see charitable_plupload_image_upload |
| 32 |
*/ |
| 33 |
add_action( 'wp_ajax_charitable_plupload_image_upload', 'charitable_plupload_image_upload' ); |
| 34 |
add_action( 'wp_ajax_nopriv_charitable_plupload_image_upload', 'charitable_plupload_image_upload' ); |
| 35 |
|
| 36 |
/** |
| 37 |
* Retrieve the details for a particular donor. |
| 38 |
* |
| 39 |
* @see charitable_ajax_get_donor_data |
| 40 |
*/ |
| 41 |
add_action( 'wp_ajax_charitable_get_donor_data', 'charitable_ajax_get_donor_data' ); |
| 42 |
|
| 43 |
/** |
| 44 |
* Get session content. |
| 45 |
* |
| 46 |
* @see charitable_ajax_get_session_content() |
| 47 |
*/ |
| 48 |
add_action( 'wp_ajax_charitable_get_session_content', 'charitable_ajax_get_session_content' ); |
| 49 |
add_action( 'wp_ajax_nopriv_charitable_get_session_content', 'charitable_ajax_get_session_content' ); |
| 50 |
|
| 51 |
/** |
| 52 |
* Return the content for particular templates. |
| 53 |
* |
| 54 |
* @see charitable_ajax_get_session_donation_receipt |
| 55 |
* @see charitable_ajax_get_session_donation_form_amount_field |
| 56 |
* @see charitable_ajax_get_session_donation_form_current_amount_text |
| 57 |
* @see charitable_ajax_get_session_errors |
| 58 |
* @see charitable_ajax_get_session_notices |
| 59 |
*/ |
| 60 |
add_filter( 'charitable_session_content_donation_receipt', 'charitable_ajax_get_session_donation_receipt', 10, 2 ); |
| 61 |
add_filter( 'charitable_session_content_donation_form_amount_field', 'charitable_ajax_get_session_donation_form_amount_field', 10, 2 ); |
| 62 |
add_filter( 'charitable_session_content_donation_form_current_amount_text', 'charitable_ajax_get_session_donation_form_current_amount_text', 10, 2 ); |
| 63 |
add_filter( 'charitable_session_content_errors', 'charitable_ajax_get_session_errors' ); |
| 64 |
add_filter( 'charitable_session_content_notices', 'charitable_ajax_get_session_notices' ); |
| 65 |
|