Advertisement
eventsmanager

custom placeholder for Recurrence date pattern

Jan 7th, 2017
958
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.72 KB | None | 0 0
  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);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement