Ajax
in package
TODO move each ajax controller to separate class
Tags
Table of Contents
- $actionPrefix : mixed
- $ajaxActions : mixed
- $nonceName : mixed
- __construct() : mixed
- addAjaxAction() : mixed
- apply_coupon() : mixed
- attributes_custom_ordering() : mixed
- cancel_bookings_csv() : mixed
- check_bookings_csv() : mixed
- create_stripe_payment_intent() : mixed
- dismiss_license_notice() : mixed
- display_imported_bookings() : mixed
- export_bookings_csv() : mixed
- get_accommodations_list() : mixed
- get_billing_fields() : mixed
- get_rates_for_room() : mixed
- getAdminNonces() : array<string|int, mixed>
- getFrontNonces() : array<string|int, mixed>
- ical_sync_abort() : mixed
- ical_sync_clear_all() : mixed
- ical_sync_get_progress() : mixed
- ical_sync_remove_item() : mixed
- ical_upload_abort() : mixed
- ical_upload_get_progress() : mixed
- install_plugin() : mixed
- recalculate_total() : mixed
- remove_customer() : mixed
- update_checkout_info() : mixed
- update_rate_prices() : mixed
- checkNonce() : bool
- parseAdults() : mixed
- parseCheckInDate() : DateTime
- parseCheckOutDate() : DateTime
- parseCheckoutFormBooking() : Booking
- Parse booking from checkout form values.
- parseChildren() : mixed
- retrieveInput() : array<string|int, mixed>
- verifyNonce() : mixed
Properties
$actionPrefix
protected
mixed
$actionPrefix
= 'mphb_'
$ajaxActions
protected
mixed
$ajaxActions
= array(
// Admin
// #nolite-start
'export_bookings_csv' => array(
// Start export
'method' => 'POST',
'nopriv' => false,
),
'check_bookings_csv' => array(
// Get export progress
'method' => 'GET',
'nopriv' => false,
),
'cancel_bookings_csv' => array(
// Cancel export
'method' => 'POST',
'nopriv' => false,
),
// #nolite-end
'install_plugin' => array('method' => 'POST', 'nopriv' => false),
'display_imported_bookings' => array('method' => 'POST', 'nopriv' => false),
'recalculate_total' => array('method' => 'POST', 'nopriv' => false),
'get_rates_for_room' => array('method' => 'GET', 'nopriv' => false),
'dismiss_license_notice' => array('method' => 'POST', 'nopriv' => false),
'attributes_custom_ordering' => array('method' => 'POST', 'nopriv' => false),
// Frontend
// #nolite-start
'create_stripe_payment_intent' => array('method' => 'POST', 'nopriv' => true),
// #nolite-end
'update_checkout_info' => array('method' => 'GET', 'nopriv' => true),
'update_rate_prices' => array('method' => 'GET', 'nopriv' => true),
'get_billing_fields' => array('method' => 'GET', 'nopriv' => true),
'apply_coupon' => array('method' => 'POST', 'nopriv' => true),
// #nolite-start
'ical_sync_abort' => array('method' => 'POST'),
'ical_sync_clear_all' => array('method' => 'POST'),
'ical_sync_remove_item' => array('method' => 'POST'),
'ical_sync_get_progress' => array('method' => 'POST'),
'ical_upload_get_progress' => array('method' => 'GET'),
'ical_upload_abort' => array('method' => 'POST'),
// #nolite-end
'get_accommodations_list' => array('method' => 'GET'),
'remove_customer' => array('method' => 'POST'),
)
$nonceName
protected
mixed
$nonceName
= 'mphb_nonce'
Methods
__construct()
public
__construct() : mixed
Return values
mixed —addAjaxAction()
public
addAjaxAction(string $action, bool $noPriv) : mixed
Parameters
- $action : string
- $noPriv : bool
Return values
mixed —apply_coupon()
public
apply_coupon() : mixed
Return values
mixed —attributes_custom_ordering()
public
attributes_custom_ordering() : mixed
Return values
mixed —cancel_bookings_csv()
public
cancel_bookings_csv() : mixed
Return values
mixed —check_bookings_csv()
public
check_bookings_csv() : mixed
Return values
mixed —create_stripe_payment_intent()
public
create_stripe_payment_intent() : mixed
Tags
Return values
mixed —dismiss_license_notice()
public
dismiss_license_notice() : mixed
Return values
mixed —display_imported_bookings()
public
display_imported_bookings() : mixed
Return values
mixed —export_bookings_csv()
public
export_bookings_csv() : mixed
Return values
mixed —get_accommodations_list()
public
get_accommodations_list() : mixed
Return values
mixed —get_billing_fields()
public
get_billing_fields() : mixed
Return values
mixed —get_rates_for_room()
public
get_rates_for_room() : mixed
Return values
mixed —getAdminNonces()
public
getAdminNonces() : array<string|int, mixed>
Return values
array<string|int, mixed> —getFrontNonces()
public
getFrontNonces() : array<string|int, mixed>
Return values
array<string|int, mixed> —ical_sync_abort()
public
ical_sync_abort() : mixed
Return values
mixed —ical_sync_clear_all()
public
ical_sync_clear_all() : mixed
Return values
mixed —ical_sync_get_progress()
public
ical_sync_get_progress() : mixed
Return values
mixed —ical_sync_remove_item()
public
ical_sync_remove_item() : mixed
Return values
mixed —ical_upload_abort()
public
ical_upload_abort() : mixed
Return values
mixed —ical_upload_get_progress()
public
ical_upload_get_progress() : mixed
Return values
mixed —install_plugin()
public
install_plugin() : mixed
Tags
Return values
mixed —recalculate_total()
public
recalculate_total() : mixed
Return values
mixed —remove_customer()
public
remove_customer() : mixed
Return values
mixed —update_checkout_info()
public
update_checkout_info() : mixed
Return values
mixed —update_rate_prices()
public
update_rate_prices() : mixed
Return values
mixed —checkNonce()
protected
checkNonce(string $action) : bool
Parameters
- $action : string
Return values
bool —parseAdults()
protected
parseAdults(mixed $input[, mixed $allowEmptyString = false ]) : mixed
Parameters
- $input : mixed
- $allowEmptyString : mixed = false
Return values
mixed —parseCheckInDate()
protected
parseCheckInDate(string $input) : DateTime
Parameters
- $input : string
-
Date string.
Return values
DateTime —parseCheckOutDate()
protected
parseCheckOutDate(string $input) : DateTime
Parameters
- $input : string
-
Date string.
Return values
DateTime —parseCheckoutFormBooking()
Parse booking from checkout form values.
protected
parseCheckoutFormBooking(array<string|int, mixed> $input) : Booking
Parameters
- $input : array<string|int, mixed>
Return values
Booking —parseChildren()
protected
parseChildren(mixed $input[, mixed $allowEmptyString = false ]) : mixed
Parameters
- $input : mixed
- $allowEmptyString : mixed = false
Return values
mixed —retrieveInput()
protected
retrieveInput(string $action) : array<string|int, mixed>
Parameters
- $action : string
-
Name of AJAX action without wp prefix.
Return values
array<string|int, mixed> —verifyNonce()
protected
verifyNonce(string $action) : mixed
Parameters
- $action : string