From 44b49c6fc3f5fed6591a53736d7c7ce809f27cab Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 18 Sep 2019 22:42:55 +0000 Subject: [PATCH] Script Loader: Move the `current_theme_supports()` check above the `wp_default_(scripts|styles)` action, for consistency. See #42804. Built from https://develop.svn.wordpress.org/trunk@46171 git-svn-id: http://core.svn.wordpress.org/trunk@45983 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class.wp-scripts.php | 8 ++++---- wp-includes/class.wp-styles.php | 8 ++++---- wp-includes/version.php | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/wp-includes/class.wp-scripts.php b/wp-includes/class.wp-scripts.php index 00a782b3ef..9d1b706343 100644 --- a/wp-includes/class.wp-scripts.php +++ b/wp-includes/class.wp-scripts.php @@ -141,10 +141,6 @@ class WP_Scripts extends WP_Dependencies { public function __construct() { $this->init(); add_action( 'init', array( $this, 'init' ), 0 ); - - if ( ! is_admin() && ! current_theme_supports( 'html5', 'script' ) ) { - $this->type_attr = " type='text/javascript'"; - } } /** @@ -153,6 +149,10 @@ class WP_Scripts extends WP_Dependencies { * @since 3.4.0 */ public function init() { + if ( ! is_admin() && ! current_theme_supports( 'html5', 'script' ) ) { + $this->type_attr = " type='text/javascript'"; + } + /** * Fires when the WP_Scripts instance is initialized. * diff --git a/wp-includes/class.wp-styles.php b/wp-includes/class.wp-styles.php index 3673b9e319..4c1d4f53a1 100644 --- a/wp-includes/class.wp-styles.php +++ b/wp-includes/class.wp-styles.php @@ -117,6 +117,10 @@ class WP_Styles extends WP_Dependencies { * @since 2.6.0 */ public function __construct() { + if ( ! is_admin() && ! current_theme_supports( 'html5', 'style' ) ) { + $this->type_attr = " type='text/css'"; + } + /** * Fires when the WP_Styles instance is initialized. * @@ -125,10 +129,6 @@ class WP_Styles extends WP_Dependencies { * @param WP_Styles $this WP_Styles instance (passed by reference). */ do_action_ref_array( 'wp_default_styles', array( &$this ) ); - - if ( ! is_admin() && ! current_theme_supports( 'html5', 'style' ) ) { - $this->type_attr = " type='text/css'"; - } } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index f93871c0a4..07458825b7 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-alpha-46170'; +$wp_version = '5.3-alpha-46171'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.