Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #24197, comment 2


Ignore:
Timestamp:
04/27/2013 10:15:00 AM (11 years ago)
Author:
t31os_
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #24197, comment 2

    initial v1  
    2727
    2828However, again the vars are not output in the page, specifically when they are created for the jquery handle. Not sure why any of this occurs, just wanted to confirm i can replicate the issue being described in trunk.
     29
     30'''EDIT: I took a look at wp_default_scripts'''
     31{{{
     32// jQuery
     33$scripts->add( 'jquery', false, array( 'jquery-core', 'jquery-migrate' ) );
     34$scripts->add( 'jquery-core', '/wp-includes/js/jquery/jquery.js', array(), '1.9.1' );
     35$scripts->add( 'jquery-migrate', '/wp-includes/js/jquery/jquery-migrate.js', array(), '1.1.1' );
     36}}}
     37
     38And noticed the jquery handle is really just a alias for jquery-core, and found this works as expected.
     39{{{
     40wp_localize_script( 'jquery-core', 'myvars', array( 'foo' => 'bar' ) );
     41}}}