<?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