[wp-trac] [WordPress Trac] #24834: wp_enqueue_script passing null for $ver produces unexpected results
WordPress Trac
noreply at wordpress.org
Tue Aug 6 11:36:33 UTC 2013
#24834: wp_enqueue_script passing null for $ver produces unexpected results
--------------------------+-----------------------
Reporter: bobbingwide | Owner:
Type: defect (bug) | Status: reopened
Priority: normal | Milestone:
Component: General | Version: 3.5.2
Severity: normal | Resolution:
Keywords: close |
--------------------------+-----------------------
Comment (by bobbingwide):
Replying to [comment:14 helen]:
> What exactly is it you are trying to accomplish here?
I'm trying to pass a query string but not have ver= set
This is to cater for a restriction with some external JavaScript that I
have no control over.
There is a possibility that the same URL could be invoked multiple times
with different query strings where the server delivers different
JavaScript source depending on the value of the parameters.
> Or try a function like sanitize_key()
Yes, that's tidier.
> Your patch would change current behavior.
Well that was the plan! The current behaviour doesn't support $ver=null.
But I agree that my patch doesn't cater for the query parms in the handle.
Replying to [comment:15 azaozz]:
IMHO, the defect is valid, but there is a work around.
So perhaps the defect should be closed as wontfix, for all the reasons
given above.
Another scenario is when the same shortcode gets expanded in multiple
places on the page.
If the handles are identical then the script should only be loaded once.
In this scenario the uniqid() and $number++ solutions won't work but the
sanitize_key() solution does.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/24834#comment:16>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list