The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

WP jQuery CDN
init hook is not recommended and can you add a feature to setup user library (3 posts)

  1. librazh
    Posted 4 years ago #

    1. The 'init' hook is not recommended while registering the script libraries. So I updated the plugin by myself, and it works. Please refer to http://codex.wordpress.org/Function_Reference/wp_enqueue_script which mentioned that "by using the wp_enqueue_scripts hook (instead of the init hook which many articles reference), we avoid registering the alternate jQuery on admin pages, which will cause post editing (amongst other things) to break after upgrades often."

    2. There is no way in the plugin to add my own jQuery library served on another CDN, so I have to modify the plugin by myself. It may cause setting losing if the plugin is being upgraded. Can you add a feature to let the user input the library URL by themselves?


  2. librazh
    Posted 4 years ago #

    One more problem, the plugin is generating below URL for script, is it correct?

    <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery//jquery.min.js?ver=3.3.1'></script>

  3. InertiaInMotion
    Plugin Author

    Posted 4 years ago #

    Hi Librazh,

    Thanks for the suggestions, And sorry about the HUGE! delay in this response, We have become quite busy this year and have had very little time to tinker with other little side projects such as this plugin.

    Also in regards to the problem you are experiencing.
    I gather you have selected the Google CDN option,
    Are you able to provide me with some more information?

    Such as.
    What version of the plugin are you running?
    What is entered in the jQuery Version input field?
    Have you modified the plugin in any way?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP jQuery CDN
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic