Make WordPress Core

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


Ignore:
Timestamp:
06/29/2013 10:35:49 PM (12 years ago)
Author:
azaozz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #24197, comment 14

    initial v1  
    33Yeah, we will need another loop through all handles right before printing/outputting them. That extra loop will slow this down.
    44
    5 This can be in `print_scripts()` in class.wp-scripts.php or in wp-dependencies.php so it works when adding styles too. The main logic is in 24197.patch and can probably be cleaned up a bit.
     5This can be in `print_scripts()` in class.wp-scripts.php or in wp-dependencies.php so it works when adding styles too. The main logic is in 24197.patch and can probably be cleaned up a bit.
     6
     7To test:
     8
     9{{{
     10// localize on a group handle
     11add_action( 'admin_init', '_test_localize_empty' );
     12function _test_localize_empty() {
     13        wp_localize_script( 'jquery', 'myvars', array( 'foo' => 'bar' ) );
     14        // wp_localize_script( 'jquery-core', 'myvars', array( 'foo2' => 'bar2' ) );
     15}
     16}}}
     17
     18If the first dependency has any localization (data), it will have priority over the data moved from the group handle (uncomment to test).