eventsmanager

custom conditional placeholder is_frontend

Jul 29th, 2013
153
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. add_action('em_event_output_condition', 'my_em_frontend_event_output_condition', 1, 4);
  2. function my_em_frontend_event_output_condition($replacement, $condition, $match, $EM_Event){
  3. if( is_object($EM_Event) && preg_match('/^is_frontend$/',$condition, $matches) && is_array( $EM_Event->styles ) ){
  4. if( !empty($EM_Event->event_owner_anonymous) ){
  5. $replacement = preg_replace("/\{\/?$condition\}/", '', $match);
  6. }else{
  7. $replacement = '';
  8. }
  9. }
  10. return $replacement;
  11. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×