id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,focuses
24834,wp_enqueue_script passing null for $ver produces unexpected results,bobbingwide,,"This is a follow on to #16699.
The documentation states that you can pass a null parameter as the version to prevent any version number being printed.
See source (http://core.trac.wordpress.org/browser/trunk/wp-includes/functions.wp-scripts.php#L37 ) and codex (http://codex.wordpress.org/Function_Reference/wp_enqueue_script )
In my experience passing null still produces a ver= query string
which includes the original query string.
There are also some unexpected changes to the original $src
{{{
$src = ""http://www.example.com/widget.js?token=something%3d%3d"";
wp_enqueue_script( $src, $src, array( ""jquery""), null );
}}}
produces
{{{
}}}
There are two problems here
1. the ver= parameter is still being created
2. The %3d part of the token was unexpectedly capitalized to %3D in the first occurrence of token=
The problem is in do_item() ( wp-includes/class.wp-scripts.php )
The conversion of %3d to %3D is performed by add_query_arg('ver', $ver, $src);
Up to this point $src was the original (wanted) string.
Had add_query_arg() not been invoked the $src would have been as required.
My questions are these?
Is this a bug in the code or a bug in the documentation?
If not a bug in the code then HOW can I call wp_enqueue_script() so that my required $src IS respected?
What if I really did require '%3d' to be passed as '%3d'?
",defect (bug),closed,normal,,General,3.5.2,normal,invalid,close,,