Advertisement
Beee

Conditional placeholder locations

May 15th, 2013
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.55 KB | None | 0 0
  1. function website_location_output_condition($replacement, $condition, $match, $EM_Location){
  2.     if( is_object($EM_Location) && preg_match('/^has_website$/',$condition, $matches) ){
  3.         if( !in_array($args['website'],$EM_Location->event_attributes) && !empty($EM_Location->event_attributes['website']) ){
  4.             $replacement = preg_replace("/\{\/?$condition\}/", '', $match);
  5.         }else{
  6.             $replacement = '';
  7.         }
  8.     }
  9.     return $replacement;
  10. }
  11. add_action('em_location_output_condition', 'website_location_output_condition', 1, 4)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement