Ticket #42804: 42804.2.diff
File 42804.2.diff, 1.6 KB (added by , 6 years ago) |
---|
-
src/wp-includes/class.wp-scripts.php
149 149 * @since 3.4.0 150 150 */ 151 151 public function init() { 152 if ( ! is_admin() && ! current_theme_supports( 'html5', 'script' ) ) {152 if ( function_exists( 'is_admin' ) && ! is_admin() && function_exists( 'current_theme_supports' ) && ! current_theme_supports( 'html5', 'script' ) ) { 153 153 $this->type_attr = " type='text/javascript'"; 154 154 } 155 155 … … 220 220 return $output; 221 221 } 222 222 223 echo "<script{$this->type_attr}>\n"; // CDATA and type="text/javascript" is not needed for HTML 5. 224 echo "/* <![CDATA[ */\n"; 223 echo "<script{$this->type_attr}>\n"; 224 225 if ( $this->type_attr ) { 226 echo "/* <![CDATA[ */\n"; 227 } 228 225 229 echo "$output\n"; 226 echo "/* ]]> */\n"; 230 231 if ( $this->type_attr ) { 232 echo "/* ]]> */\n"; 233 } 234 227 235 echo "</script>\n"; 228 236 229 237 return true; -
src/wp-includes/class.wp-styles.php
117 117 * @since 2.6.0 118 118 */ 119 119 public function __construct() { 120 if ( ! is_admin() && ! current_theme_supports( 'html5', 'style' ) ) {120 if ( function_exists( 'is_admin' ) && ! is_admin() && function_exists( 'current_theme_supports' ) && ! current_theme_supports( 'html5', 'style' ) ) { 121 121 $this->type_attr = " type='text/css'"; 122 122 } 123 123