[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:29:18 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 somatic):

 Thx for the explanation. As for attaching to `jquery` handle, you're
 right, it would be more accurate to attach to our own scripts. So many
 `localize` tutorials for passing variables to javascript seem to default
 to `jquery`, that I never thought about it. I guess part of the assumption
 was that `jquery` handle, being in core, and used by pretty much
 everything, was a safe bet - and also possibly that it would make that
 data available even in cases where you weren't necessarily explicitly
 enqueuing your own script (maybe echoing some inline js).

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/24197#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list