• Resolved Palpatine1976

    (@palpatine1976)


    Hi –

    I’m trying to roll Events Manager + FC into my theme, without having to touch plugin core code. The only thing I’ve found so far is that I can’t stop the WPFC plugin from including the inline JS from /js/inline.js.

    Since I want to control the calendar completely from my theme, could you add a filter for the inclusion of that code? That way I can use a theme JS file for all the FullCalendar settings. Hopefully it’s a simple as an apply_filters() line around #302 in wp-fullcalendar.php

    Thanks!

    https://ww.wp.xz.cn/plugins/wp-fullcalendar/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    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

    Thread Starter Palpatine1976

    (@palpatine1976)

    * 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!

    Plugin Support angelo_nwl

    (@angelo_nwl)

    this is already been requested but no eta yet due to other stuff which needs to be done first.

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    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.

    Thread Starter Palpatine1976

    (@palpatine1976)

    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!

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    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 🙂

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Please add filter for inline.js inclusion’ is closed to new replies.