Created
September 2, 2021 16:48
-
-
Save Pebblo/2d39c12c71784576ef259e751aa0d8fb to your computer and use it in GitHub Desktop.
Example of how to filter the calendar event time to remove the times if you have a hide-event-times custom field set on the event.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('FHEE__EE_Calendar__get_calendar_events__event_time_html', 'tw_ee_filter_calendar_event_time_html', 10, 3); | |
function tw_ee_filter_calendar_event_time_html( $html, $datetime, $event ) { | |
// Don't show event times if the event has a 'hide-event-times' custom field set. | |
if( get_post_meta( $event->ID(), 'hide-event-times', true ) ) { | |
return false; | |
} | |
return $html; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment