Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Function: Events Manager 'has_VenueURL' Custom Conditional Placeholder
- */
- add_action('em_event_output_condition', 'my_em_VenueURL_event_output_condition', 1, 4);
- function my_em_VenueURL_event_output_condition($replacement, $condition, $match, $EM_Event){
- if( is_object($EM_Event) && preg_match('/^has_VenueURL_(.+)$/',$condition, $matches) && is_array( $EM_Event->VenueURL ) ){
- if( in_array($matches[1],$EM_Event->VenueURL) ){
- $replacement = preg_replace("/\{\/?$condition\}/", '', $match);
- }else{
- $replacement = '';
- }
- }
- return $replacement;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement