File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -2869,7 +2869,7 @@ function wp_enqueue_editor_format_library_assets() {
28692869 * @return string String made of sanitized `<script>` tag attributes.
28702870 */
28712871function 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 ) );
You can’t perform that action at this time.
0 commit comments