eventsmanager

Custom conditional placeholder {is_recurrence}

Aug 21st, 2025 (edited)
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. <?php
  2.  
  3. add_action('em_event_output_condition', 'my_em_custom_event_output_condition', 100, 4);
  4. function my_em_custom_event_output_condition($replacement, $condition, $match, $EM_Event){
  5. if( is_object($EM_Event) && preg_match('/^is_recurrence$/',$condition, $matches) ){
  6. if( $EM_Event->is_recurrence( true ) ){
  7. $replacement = preg_replace("/\{\/?$condition\}/", '', $match);
  8. }else{
  9. $replacement = '';
  10. }
  11. }
  12. return $replacement;
  13. }
  14.  
Advertisement
Add Comment
Please, Sign In to add comment