Skip to content

Commit b2d4803

Browse files
committed
Don't show timezone if it's an "all day" event
1 parent dadb1df commit b2d4803

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ mu-plugins/*
2020
!mu-plugins/osi-event-list
2121
!mu-plugins/osi-sponsors-list
2222
!websub-compat.php
23+
!mu-plugins/osi-events-manager-tweaks
2324

2425
themes/*
2526
!themes/osi
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
/**
3+
* Plugin Name: OSI Events Manager Tweaks
4+
* Description: Customizations for the Events Manager plugin.
5+
* Version: 1.0.0
6+
* Author: WordPress.com Special Projects
7+
* Author URI: https://wpspecialprojects.wordpress.com/
8+
*/
9+
10+
add_filter('em_event_output_placeholder', 'osi_em_event_output_placeholder', 10, 5);
11+
function osi_em_event_output_placeholder( $replace, $EM_Event, $full_result, $target, $placeholder_atts ) {
12+
if ( '#_EVENTTIMEZONE' === $full_result ) {
13+
$event_times = $EM_Event->output('#_EVENTTIMES');
14+
if ( 'All Day' === $event_times ) {
15+
$replace = '';
16+
}
17+
}
18+
return $replace;
19+
}

0 commit comments

Comments
 (0)