Make WordPress Core

Changeset 46171


Ignore:
Timestamp:
09/18/2019 10:41:29 PM (6 years ago)
Author:
SergeyBiryukov
Message:

Script Loader: Move the current_theme_supports() check above the wp_default_(scripts|styles) action, for consistency.

See #42804.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class.wp-scripts.php

    r46170 r46171  
    142142        $this->init();
    143143        add_action( 'init', array( $this, 'init' ), 0 );
    144 
     144    }
     145
     146    /**
     147     * Initialize the class.
     148     *
     149     * @since 3.4.0
     150     */
     151    public function init() {
    145152        if ( ! is_admin() && ! current_theme_supports( 'html5', 'script' ) ) {
    146153            $this->type_attr = " type='text/javascript'";
    147154        }
    148     }
    149 
    150     /**
    151      * Initialize the class.
    152      *
    153      * @since 3.4.0
    154      */
    155     public function init() {
     155
    156156        /**
    157157         * Fires when the WP_Scripts instance is initialized.
  • trunk/src/wp-includes/class.wp-styles.php

    r46170 r46171  
    118118     */
    119119    public function __construct() {
     120        if ( ! is_admin() && ! current_theme_supports( 'html5', 'style' ) ) {
     121            $this->type_attr = " type='text/css'";
     122        }
     123
    120124        /**
    121125         * Fires when the WP_Styles instance is initialized.
     
    126130         */
    127131        do_action_ref_array( 'wp_default_styles', array( &$this ) );
    128 
    129         if ( ! is_admin() && ! current_theme_supports( 'html5', 'style' ) ) {
    130             $this->type_attr = " type='text/css'";
    131         }
    132132    }
    133133
Note: See TracChangeset for help on using the changeset viewer.