Best Practice for deregistering jQUery

Home Forums Calendar Products Events Calendar PRO Best Practice for deregistering jQUery

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1180790
    Steve Guy
    Participant

    The calendar’s AJAX navigation was not working for us initially. After research I did determine that a version of jQuery (1.12.4) was causing the issue. I registered the jquery library using wp_enqueue_script().

    I don’t need this jQuery reference on the tribe templates… but not sure the best practice for excluding it. I’ve tried deregistering the script (wp_deregister_script), plus removing the action that initializes the script… but to no avail.

    What is the best way to approach this? I do need the script call with the remainder of the site.

    #1181370
    George
    Participant

    Hey Steve,

    Thanks for reaching out.

    The best practice is to have no custom registration or de-registration of jQuery whatsoever. SO, when you say, ” I registered the jquery library using wp_enqueue_script().”, what I would recommend doing is removing all custom registrations of jQuery on your site.

    WordPress Core provides its own built-in version of jQuery, and it is very bad practice to alter this version at all.

    So, ensure that you’re not using any custom-loaded version of jQuery, and that your theme itself is also not de-registering/re-registering its own version of jQuery.

    In this state, how do things behave? If things are broken, then can you share a link to the specific events page where it’s broken? I’ll take a closer look with that and see if I can try and identify the problem more specifically.

    Thanks,
    George

    #1191598
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Best Practice for deregistering jQUery’ is closed to new replies.