Skip to content

Commit

Permalink
Don't show timezone if it's an "all day" event
Browse files Browse the repository at this point in the history
  • Loading branch information
bernattorras committed May 17, 2024
1 parent 229c14f commit 0c383dd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ mu-plugins/*
!mu-plugins/mu-autoloader.php
!mu-plugins/osi-event-list
!mu-plugins/osi-sponsors-list
!mu-plugins/osi-events-manager-tweaks

themes/*
!themes/osi
Expand Down
19 changes: 19 additions & 0 deletions mu-plugins/osi-events-manager-tweaks/osi-events-manager-tweaks.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
/**
* Plugin Name: OSI Events Manager Tweaks
* Description: Customizations for the Events Manager plugin.
* Version: 1.0.0
* Author: WordPress.com Special Projects
* Author URI: https://wpspecialprojects.wordpress.com/
*/

add_filter('em_event_output_placeholder', 'osi_em_event_output_placeholder', 10, 5);
function osi_em_event_output_placeholder( $replace, $EM_Event, $full_result, $target, $placeholder_atts ) {
if ( '#_EVENTTIMEZONE' === $full_result ) {
$event_times = $EM_Event->output('#_EVENTTIMES');
if ( 'All Day' === $event_times ) {
$replace = '';
}
}
return $replace;
}

0 comments on commit 0c383dd

Please sign in to comment.