Created
November 13, 2018 13:58
-
-
Save alexstandiford/d15f950f304c290f6fbaab23d5000820 to your computer and use it in GitHub Desktop.
Injects a plugin directory into The Events Calendar Template Location checks
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 | |
//Inject Events Calendar template controls in this plugin | |
add_filter('tribe_events_template', function($file, $template){ | |
$override_template = TKGEM_ROOT_DIR.'tribe-events/'.$template; | |
$theme_template = trailingslashit(get_stylesheet_directory()).'tribe-events/'.$template; | |
if(file_exists($override_template) && !file_exists($theme_template)){ | |
$file = TKGEM_ROOT_DIR.'tribe-events/single-event.php'; | |
} | |
return $file; | |
}, 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment