If someone tries to localize 'jquery', which is now an alias with jquery-core and jquery-migrate dependencies, add the data to jquery-core.

fixes #24197.



git-svn-id: https://develop.svn.wordpress.org/trunk@24635 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-07-10 05:38:17 +00:00
parent 3a1e87c205
commit 8a9ea82d2b
1 changed files with 3 additions and 0 deletions

View File

@ -133,6 +133,9 @@ class WP_Scripts extends WP_Dependencies {
* Localizes only if the script has already been added * Localizes only if the script has already been added
*/ */
function localize( $handle, $object_name, $l10n ) { function localize( $handle, $object_name, $l10n ) {
if ( $handle === 'jquery' )
$handle = 'jquery-core';
if ( is_array($l10n) && isset($l10n['l10n_print_after']) ) { // back compat, preserve the code in 'l10n_print_after' if present if ( is_array($l10n) && isset($l10n['l10n_print_after']) ) { // back compat, preserve the code in 'l10n_print_after' if present
$after = $l10n['l10n_print_after']; $after = $l10n['l10n_print_after'];
unset($l10n['l10n_print_after']); unset($l10n['l10n_print_after']);