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.
Built from https://develop.svn.wordpress.org/trunk@46170


git-svn-id: http://core.svn.wordpress.org/trunk@45982 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2019-09-18 22:34:56 +00:00
parent 16c9095e33
commit e9b6e9619e
3 changed files with 3 additions and 3 deletions

View File

@ -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'";
}
}

View File

@ -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'";
}
}

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.3-alpha-46169';
$wp_version = '5.3-alpha-46170';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.