diff --git a/src/wp-includes/class-wp-scripts.php b/src/wp-includes/class-wp-scripts.php
index 5374aa912a..b999455daa 100644
a
|
b
|
class WP_Scripts extends WP_Dependencies { |
511 | 511 | if ( is_string( $l10n ) ) { |
512 | 512 | $l10n = html_entity_decode( $l10n, ENT_QUOTES, 'UTF-8' ); |
513 | 513 | } elseif ( is_array( $l10n ) ) { |
514 | | foreach ( $l10n as $key => $value ) { |
515 | | if ( ! is_scalar( $value ) ) { |
516 | | continue; |
| 514 | $l10n = map_deep( |
| 515 | $l10n, |
| 516 | function( $value ) { |
| 517 | if ( ! is_scalar( $value ) ) { |
| 518 | return; |
| 519 | } |
| 520 | return html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8' ); |
517 | 521 | } |
518 | | |
519 | | $l10n[ $key ] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8' ); |
520 | | } |
| 522 | ); |
521 | 523 | } |
522 | 524 | |
523 | 525 | $script = "var $object_name = " . wp_json_encode( $l10n ) . ';'; |