Make WordPress Core

Changeset 46170


Ignore:
Timestamp:
09/18/2019 10:33:45 PM (7 years ago)
Author:
SergeyBiryukov
Message:

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.

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

Legend:

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

    r46164 r46170  
    143143                add_action( 'init', array( $this, 'init' ), 0 );
    144144
    145                 if ( ! current_theme_supports( 'html5', 'script' ) ) {
     145                if ( ! is_admin() && ! current_theme_supports( 'html5', 'script' ) ) {
    146146                        $this->type_attr = " type='text/javascript'";
    147147                }
  • trunk/src/wp-includes/class.wp-styles.php

    r46164 r46170  
    127127                do_action_ref_array( 'wp_default_styles', array( &$this ) );
    128128
    129                 if ( ! current_theme_supports( 'html5', 'style' ) ) {
     129                if ( ! is_admin() && ! current_theme_supports( 'html5', 'style' ) ) {
    130130                        $this->type_attr = " type='text/css'";
    131131                }
Note: See TracChangeset for help on using the changeset viewer.