[wp-trac] [WordPress Trac] #24197: wp_localize_script() doesn't work on admin_enqueue_scripts action
WordPress Trac
noreply at wordpress.org
Wed May 1 19:21:25 UTC 2013
#24197: wp_localize_script() doesn't work on admin_enqueue_scripts action
--------------------------+--------------------
Reporter: IcyPixels | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.6
Component: General | Version: trunk
Severity: major | Resolution:
Keywords: dev-feedback |
--------------------------+--------------------
Comment (by azaozz):
> If this "jquery-migrate" is fouling it up...
The problem is not with `jquery-migrate`. Currently the `jquery` handle is
not a "real" handle but rather an alias for enqueueing both jQuery and
jQuery Migrate at the same time. As `jquery` is not "printed", any data
attached to it is not printed either.
Wondering why plugins attach data to the `jquery` handle instead of their
own scripts. The "localize" functionality makes sure dynamic data is
outputted before the inclusion of a script that needs is. Attaching that
data to a different script is not right and can break as in this case.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/24197#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list