Make WordPress Core


Ignore:
Timestamp:
09/24/2019 02:55:56 AM (6 years ago)
Author:
SergeyBiryukov
Message:

Script Loader: Add function_exists() checks for is_admin() and current_theme_supports(), to accomodate for using WP_Dependencies as a standalone class.

Remove <![CDATA[ when outputting HTML5 script tags.

Props azaozz.
Fixes #42804.

File:
1 edited

Legend:

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

    r46171 r46287  
    118118     */
    119119    public function __construct() {
    120         if ( ! is_admin() && ! current_theme_supports( 'html5', 'style' ) ) {
     120        if (
     121            function_exists( 'is_admin' ) && ! is_admin()
     122        &&
     123            function_exists( 'current_theme_supports' ) && ! current_theme_supports( 'html5', 'style' )
     124        ) {
    121125            $this->type_attr = " type='text/css'";
    122126        }
Note: See TracChangeset for help on using the changeset viewer.