eventsmanager

custom placeholder for Recurrence date pattern

Jan 7th, 2017
312
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /**
  3.  * The function below adds a placeholder to describe a recurrence pattern, or outputs nothing if event isn't a recurrence.
  4.  * For instructions on how to install this snippet, see here - http://wp-events-plugin.com/tutorials/how-to-safely-add-php-code-to-wordpress/
  5.  *
  6.  * @param string $replace
  7.  * @param EM_Event $EM_Event
  8.  * @param string $result
  9.  * @return string
  10.  */
  11. function my_em_event_recurrences_placeholder($replace, $EM_Event, $result){
  12.     if( $result == '#_EVENTRECURRENCEDATES' ){
  13.         $replace = '';
  14.         if( $EM_Event->is_recurrence() ){
  15.             $replace = $EM_Event->get_recurrence_description();
  16.         }
  17.     }
  18.     return $replace;
  19. }
  20. add_filter('em_event_output_placeholder','my_em_event_recurrences_placeholder',1,3);
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.

×