From bf759fe2072563dc74864bbb310e1c6faa8aae50 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 10 Jul 2013 05:38:17 +0000 Subject: [PATCH] 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: http://core.svn.wordpress.org/trunk@24635 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class.wp-scripts.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/class.wp-scripts.php b/wp-includes/class.wp-scripts.php index f75929b4ab..38f3f9fcf3 100644 --- a/wp-includes/class.wp-scripts.php +++ b/wp-includes/class.wp-scripts.php @@ -133,6 +133,9 @@ class WP_Scripts extends WP_Dependencies { * Localizes only if the script has already been added */ 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 $after = $l10n['l10n_print_after']; unset($l10n['l10n_print_after']);