From 88bf910518e7fbc4ee47e171fcd4933ef87cf6bd Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 18 Sep 2019 22:33:45 +0000 Subject: [PATCH] Script Loader: Only check current theme's HTML5 support for scripts and styles on front end. Avoids a fatal error in the admin if `SCRIPT_DEBUG` is disabled. Props azaozz. See #42804. git-svn-id: https://develop.svn.wordpress.org/trunk@46170 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class.wp-scripts.php | 2 +- src/wp-includes/class.wp-styles.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/class.wp-scripts.php b/src/wp-includes/class.wp-scripts.php index 2cda5a2990..00a782b3ef 100644 --- a/src/wp-includes/class.wp-scripts.php +++ b/src/wp-includes/class.wp-scripts.php @@ -142,7 +142,7 @@ class WP_Scripts extends WP_Dependencies { $this->init(); add_action( 'init', array( $this, 'init' ), 0 ); - if ( ! current_theme_supports( 'html5', 'script' ) ) { + if ( ! is_admin() && ! current_theme_supports( 'html5', 'script' ) ) { $this->type_attr = " type='text/javascript'"; } } diff --git a/src/wp-includes/class.wp-styles.php b/src/wp-includes/class.wp-styles.php index ebb9a596f0..3673b9e319 100644 --- a/src/wp-includes/class.wp-styles.php +++ b/src/wp-includes/class.wp-styles.php @@ -126,7 +126,7 @@ class WP_Styles extends WP_Dependencies { */ do_action_ref_array( 'wp_default_styles', array( &$this ) ); - if ( ! current_theme_supports( 'html5', 'style' ) ) { + if ( ! is_admin() && ! current_theme_supports( 'html5', 'style' ) ) { $this->type_attr = " type='text/css'"; } }