| 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. |
| | 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. |
| | 6 | |
| | 7 | To test: |
| | 8 | |
| | 9 | {{{ |
| | 10 | // localize on a group handle |
| | 11 | add_action( 'admin_init', '_test_localize_empty' ); |
| | 12 | function _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 | |
| | 18 | If the first dependency has any localization (data), it will have priority over the data moved from the group handle (uncomment to test). |