Advertisement
eventsmanager

Custom Booking Conditional Placeholder

Dec 18th, 2024
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4. where "demo" is the booking form ID
  5. {is_checkbox} show this message {/is_checkbox}
  6. */
  7.  
  8. function my_em_booking_output_condition($replacement, $condition, $match, $EM_Booking){
  9. if( is_object($EM_Booking) && preg_match('/^is_checkbox/',$condition, $matches) ){
  10. if( $EM_Booking->booking_meta['demo'] == 'test' ){
  11. $replacement = preg_replace("/\{\/?$condition\}/", '', $match);
  12. }else{
  13. $replacement = '';
  14. }
  15. }
  16. return $replacement;
  17. }
  18. add_action('em_booking_output_condition', 'my_em_booking_output_condition', 1, 4);
  19.  
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement