Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Created September 2, 2021 16:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pebblo/2d39c12c71784576ef259e751aa0d8fb to your computer and use it in GitHub Desktop.
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.
<?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