Tribe__Tickets_Plus__Tickets_View::save_attendee_info()
Updates attendee meta from ajax request
Return
(void)
Source
File: src/Tribe/Tickets_View.php
public function save_attendee_info() {
if (
! isset( $_POST['nonce'] )
|| ! wp_verify_nonce( $_POST['nonce'], 'save_attendee_info' )
) {
wp_send_json_error( null, 403 );
}
if ( empty( $_POST['event_id'] ) ) {
wp_send_json_error( null, 400 );
}
/*
* There are hooks on wp_loaded (See various process_front_end_tickets_form methods) that handle saving of the
* ticket meta from $_POST by Tribe__Tickets_Plus__Meta__Storage::maybe_set_attendee_meta_cookie.
*/
/**
* Get all tickets currently in the cart.
*
* @since 4.9
*
* @param array $tickets Array indexed by ticket id with quantity as the value
*
* @return array
*/
$tickets_in_cart = apply_filters( 'tribe_tickets_tickets_in_cart', array() );
$meta_up_to_date = tribe( 'tickets-plus.meta.contents' )->is_stored_meta_up_to_date( $tickets_in_cart );
wp_send_json_success( array(
'meta_up_to_date' => $meta_up_to_date,
) );
}
Changelog
| Version | Description |
|---|---|
| 4.10.1 | Introduced. |