I’m trying to remove the version number from appearing in the URL generated by wp_enqueue_script
. It seems like I should pass a null
on the 4th parameter per http://codex.wordpress.org/Function_Reference/wp_enqueue_script:
wp_enqueue_script('jquery', false, array(), null, false);
It’s not working. I still see the version number. How do I remove that?
Also, how do I use wp_enqueue_script
so that I get jQuery from the Google CDN?
You can either use
or
or you can put a generic name placeholder
But particularly with “jquery” I would deregister the default if you want to replace it
try something like this:
The $ver and $in_footer are optional. So just leave them off.
Also, if you use the google cdn then it will be hard to hide the version any way, its in the url.
An example when version is not added.
An output of code above will be:
According to documentation several variables are accepted:
If value for $
ver
is false (or not given), then automatically version of WP is used.