Created
February 8, 2017 21:06
-
-
Save joshfeck/6b8cc1d4d783c599eeda6f8af2ec9c89 to your computer and use it in GitHub Desktop.
EE4 Calendar: Open event links in a new window/tab.
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 | |
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file | |
function eecal_custom_calendar_open_events_new_tab(){ | |
wp_add_inline_script( | |
'espresso_calendar', | |
'jQuery( document ).ready(function($) { | |
$( document ).ajaxComplete(function() { | |
$("#espresso_calendar a.fc-event").attr("target", "_blank"); | |
$( "#espresso_calendar .fc-event" ) | |
.mouseover(function() { | |
$(".reg-now-btn").attr("target", "_blank"); | |
} ) | |
} ); | |
} );' | |
); | |
} | |
add_action( 'wp_enqueue_scripts', 'eecal_custom_calendar_open_events_new_tab', 11 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment