Advertisement
eventsmanager

Custom Event Time Placeholder

Apr 9th, 2024
565
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.45 KB | None | 0 0
  1. add_filter('em_event_output_placeholder','my_em_placeholder_eventtime',100,3);
  2. function my_em_placeholder_eventtime($replace, $EM_Event, $result){
  3.     if ( $result == '#_EVENTTIMECUSTOM' ) {
  4.         $time_format1 = "g:i a";
  5.         $time_format2 = "g:i a T";
  6.         $time_separator = "-";
  7.         $replace = $EM_Event->start()->copy()->setTimezone()->i18n($time_format1). $time_separator . $EM_Event->end()->copy()->setTimezone()->i18n($time_format2);
  8.     }
  9.     return $replace;
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement