Created
January 19, 2017 22:00
-
-
Save joshfeck/118f8636d34fb588505fd0b536d12f37 to your computer and use it in GitHub Desktop.
Adds the event location to the EE4 calendar event. Requires EE4.
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
function jv_ee_add_location_to_calendar_event( $text, $datetime, $event ) { | |
if ( $event instanceof EE_Event ) { | |
$venue = $event->get_first_related( 'Venue' ); | |
if ( $venue instanceof EE_Venue ) { | |
$venue_name = $venue->name(); | |
$text .= '<span>Location: ' . $venue_name . '</span>'; | |
} | |
} | |
return $text; | |
} | |
add_filter( 'FHEE__EE_Calendar__get_calendar_events__event_time_html', 'jv_ee_add_location_to_calendar_event', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment