Advertisement
eventsmanager

Location Type Conditional Placeholder

Jul 22nd, 2020
444
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. Usage:
  3. {is_zoom_meeting}
  4. <strong>Click <a href="#_EVENTLOCATION{join_url}"> <i>HERE</i></a> to start Zoom Meeting</strong> <br>
  5. {/is_zoom_meeting}
  6.  
  7. Location types:
  8. location
  9. zoom_room
  10. zoom_meeting
  11. zoom_webinar
  12. */
  13. add_action('em_event_output_condition', 'my_em_custom_conditional_event_location', 1, 4);
  14. function my_em_custom_conditional_event_location($replacement, $condition, $match, $EM_Event){
  15. if( is_object($EM_Event) && preg_match('/^is_zoom_meeting$/',$condition, $matches) ){
  16. if ( $EM_Event->event_location_type == "zoom_meeting" ){
  17. $replacement = preg_replace("/\{\/?$condition\}/", '', $match);
  18. }else{
  19. $replacement = '';
  20. }
  21. }
  22. return $replacement;
  23. }
Advertisement
RAW Paste Data Copied
Advertisement