Skip to content

Commit 17ab2b5

Browse files
committed
Give variable the expected meaning
1 parent b80cc73 commit 17ab2b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/wp-includes/script-loader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2869,7 +2869,7 @@ function wp_enqueue_editor_format_library_assets() {
28692869
* @return string String made of sanitized `<script>` tag attributes.
28702870
*/
28712871
function wp_sanitize_script_attributes( $attributes ) {
2872-
$html5_script_support = ! is_admin() && ! current_theme_supports( 'html5', 'script' );
2872+
$html5_script_support = is_admin() || current_theme_supports( 'html5', 'script' );
28732873
$attributes_string = '';
28742874

28752875
/*
@@ -2879,7 +2879,7 @@ function wp_sanitize_script_attributes( $attributes ) {
28792879
foreach ( $attributes as $attribute_name => $attribute_value ) {
28802880
if ( is_bool( $attribute_value ) ) {
28812881
if ( $attribute_value ) {
2882-
$attributes_string .= $html5_script_support ? sprintf( ' %1$s="%2$s"', esc_attr( $attribute_name ), esc_attr( $attribute_name ) ) : ' ' . esc_attr( $attribute_name );
2882+
$attributes_string .= $html5_script_support ? ' ' . esc_attr( $attribute_name ) : sprintf( ' %1$s="%2$s"', esc_attr( $attribute_name ), esc_attr( $attribute_name ) );
28832883
}
28842884
} else {
28852885
$attributes_string .= sprintf( ' %1$s="%2$s"', esc_attr( $attribute_name ), esc_attr( $attribute_value ) );

0 commit comments

Comments
 (0)