eventsmanager icon

Custom Booking Conditional Placeholder

eventsmanager | PRO | 12/18/24 03:45:08 PM UTC | 0 ⭐ | 355 👁️ | Never ⏰ | []
text |

590 B

|

None

|

0 👍

/

0 👎

<?php
 /*
 where "demo" is the booking form ID
 {is_checkbox} show this message {/is_checkbox}
*/
 function my_em_booking_output_condition($replacement, $condition, $match, $EM_Booking){
    if( is_object($EM_Booking) && preg_match('/^is_checkbox/',$condition, $matches) ){
    	if( $EM_Booking->booking_meta['demo'] == 'test' ){
            $replacement = preg_replace("/\{\/?$condition\}/", '', $match);
        }else{
            $replacement = '';
        }
    }
    return $replacement;
}
add_action('em_booking_output_condition', 'my_em_booking_output_condition', 1, 4);
 ?>

Comments