Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Last active September 19, 2024 11:20
Show Gist options
  • Save joshfeck/5d9c88fea504c0b111c3df8f24ad25d9 to your computer and use it in GitHub Desktop.
Save joshfeck/5d9c88fea504c0b111c3df8f24ad25d9 to your computer and use it in GitHub Desktop.
Add calendar scripts to a specific page. Page builder themes rejoice!
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action( 'template_redirect', 'my_add_ee_calendar_assets' );
function my_add_ee_calendar_assets() {
// change is_page() parameter to match your calendar page slug
if ( class_exists( 'EED_Espresso_Calendar' ) && is_page( 'calendar' ) ) {
global $is_espresso_calendar;
$is_espresso_calendar = TRUE;
add_action( 'wp_enqueue_scripts', array( EED_Espresso_Calendar::instance(), 'calendar_scripts' ) );
if ( EED_Espresso_Calendar::instance()->config()->tooltip->show ) {
add_filter('FHEE_load_qtip', '__return_true' );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment