Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825
MEC_HELPERS::select_event_tickets()
This is a callback method to wp_ajax_ua_mec_select_events
hook.
Contents
Description Description
The method renders a json array which is immediately followed by die function from wp_send_json.
Return Return
(Uncanny_Automatorvoid.)
Source Source
File: src/integrations/modern-events-calendar/helpers/mec-helpers.php
public function select_event_tickets() { $tickets = array(); $event_id = filter_input( INPUT_POST, 'value', FILTER_SANITIZE_NUMBER_INT ); $event_tickets = get_post_meta( $event_id, 'mec_tickets', true ); if ( ! empty( $event_tickets ) ) { foreach ( $event_tickets as $ticket_id => $event_ticket ) { $tickets[] = array( 'value' => $ticket_id, 'text' => $event_ticket['name'], ); } } wp_send_json( $tickets ); }
Expand full source code Collapse full source code View on Github