Created
April 6, 2021 21:35
-
-
Save Pebblo/40c1f8dfe29a71a041c658f5b618fd2f to your computer and use it in GitHub Desktop.
Force the EE event calendar to always use the internal links for events even if an external url has been set.
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 // Do not include the opening PHP tag if you already have one. | |
add_filter('FHEE__EE_Calendar__tooltip_event_permalink', 'tw_ee_filter_tooltip_event_permalink', 10, 3); | |
add_filter('FHEE__EE_Datetime_In_Calendar__to_array_for_json__url', 'tw_ee_filter_tooltip_event_permalink', 10, 3); | |
function tw_ee_filter_tooltip_event_permalink($permalink, $event, $datetime){ | |
// Force the calendar to alway use the event permalink on the site, even if an external URL has been set. | |
return get_permalink($event->ID()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment