Changeset 50408 for trunk/src/wp-includes/class.wp-scripts.php
- Timestamp:
- 02/22/2021 11:21:56 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class.wp-scripts.php
r49758 r50408 485 485 } 486 486 487 foreach ( (array) $l10n as $key => $value ) { 488 if ( ! is_scalar( $value ) ) { 489 continue; 487 if ( ! is_array( $l10n ) ) { 488 _doing_it_wrong( 489 __METHOD__, 490 sprintf( 491 /* translators: 1: $l10n, 2: wp_add_inline_script() */ 492 __( 'The %1$s parameter must be an array. To pass arbitrary data to scripts, use the %2$s function instead.' ), 493 '<code>$l10n</code>', 494 '<code>wp_add_inline_script()</code>' 495 ), 496 '5.7.0' 497 ); 498 } 499 500 if ( is_string( $l10n ) ) { 501 $l10n = html_entity_decode( $l10n, ENT_QUOTES, 'UTF-8' ); 502 } else { 503 foreach ( (array) $l10n as $key => $value ) { 504 if ( ! is_scalar( $value ) ) { 505 continue; 506 } 507 508 $l10n[ $key ] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8' ); 490 509 } 491 492 $l10n[ $key ] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8' );493 510 } 494 511
Note: See TracChangeset
for help on using the changeset viewer.