Skip to content
Permalink
Browse files

Script Loader: Move the `current_theme_supports()` check above the `w…

…p_default_(scripts|styles)` action, for consistency.

See #42804.

git-svn-id: https://develop.svn.wordpress.org/trunk@46171 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Sep 18, 2019
1 parent 88bf910 commit 150b301ac0ad9fbd6d41ee66e90c12fdb4d23e6d
Showing with 8 additions and 8 deletions.
  1. +4 −4 src/wp-includes/class.wp-scripts.php
  2. +4 −4 src/wp-includes/class.wp-styles.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 @@ public function __construct() {
* @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.
*
@@ -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 @@ public function __construct() {
* @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'";
}
}
/**

0 comments on commit 150b301

Please sign in to comment.
You can’t perform that action at this time.