Skip to content

Commit 5db95f2

Browse files
committed
After [31030]: if a callable is passed as the 3rd arg to wp_localize_script()/WP_Scripts->localize(), pass $handle and $object_name to the user func when invoking it.
Props jtsternberg. Fixes #26111. git-svn-id: https://develop.svn.wordpress.org/trunk@31033 602fd350-edb4-49c9-b593-d223f7449a82
1 parent c21e4f9 commit 5db95f2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/wp-includes/class.wp-scripts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public function localize( $handle, $object_name, $l10n ) {
178178
$handle = 'jquery-core';
179179

180180
if ( is_callable( $l10n ) ) {
181-
$l10n = call_user_func( $l10n );
181+
$l10n = call_user_func( $l10n, $handle, $object_name );
182182
}
183183

184184
if ( is_array($l10n) && isset($l10n['l10n_print_after']) ) { // back compat, preserve the code in 'l10n_print_after' if present

0 commit comments

Comments
 (0)