Ticket description custom conditional placeholder
-
Hi
I’m trying to add a custom conditional placeholder if an event has a ticket description or not. I created a custom placeholder for the ticket description called #EVENTTICKETS and that works on its own. But, the conditional placeholder does not seem to be working.
{has_ticketdescription}#EVENTTICKETS{/has_ticketdescription}
Here’s my code. I formatted it based on this: https://wordpress.org/support/topic/conditional-placeholder-for-_eventnotes?replies=5
add_action('em_event_output_condition', 'filterEventOutputCondition', 1, 4); function filterEventOutputCondition($replacement, $condition, $match, $EM_Event){ if( is_object($EM_Ticket) && preg_match('/^has_ticketdescription/',$condition, $matches) ){ if ( !empty($EM_Ticket->ticket_description) ){ $replacement = preg_replace("/\{\/?$condition\}/", '', $match); }else{ $replacement = ''; } } return $replacement; }But for some reason, it does not seem to be working.
Thank you for the great plugin and support!
The topic ‘Ticket description custom conditional placeholder’ is closed to new replies.