hi, I’m going to let the devs know about this.
+1
It’s a must have feature! please add this filter on inline.js
* bump *
Any chance we could get this added when you update the plugin to use FC 2.6 (it just came out, and fixes a few bugs like highlighting and droppables)
THANKS!
this is already been requested but no eta yet due to other stuff which needs to be done first.
Hi guys, sorry for the delay in replyiing. Turns out you could actually have prevented that from firing already.
We add a wp_footer action to display that inline JS when a calendar is shown on the page.
The solution would be to remove that action at some point after the calendar has been displayed:
remove_action('wp_footer', array('WP_FullCalendar','footer_js'));
I’m going to add an action to the end of the WP_Fullcalendar::calendar() function called wpfc_calendar_displayed, you could use that in the future or just add it yourself above this around line 296:
return ob_get_clean();
Depending where you’re showing the calendar, you could already use the_content with a very high priority or some other hook that fires after the calendar is shown.
Great! This little snippet worked for me:
add_action( 'wpfc_calendar_displayed', function() {
remove_action( 'wp_footer', array('WP_FullCalendar', 'footer_js') );
});
Had a shock for a second when all my custom CSS and JS broke after the update – then I diff’d and saw the calendar DOM element has had its ID attribute removed (presumably part of the ‘no multiple calendars’ update)
Quick fix and things look good – thanks again!
yes, the idea is to hopefully allow multiple calendars again, but then multiple calendars with the same id isn’t correct html. sorry for the surprise 🙂