Changeset 61411 for trunk/src/wp-includes/script-loader.php
- Timestamp:
- 12/26/2025 01:14:22 PM (5 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/script-loader.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/script-loader.php
r61388 r61411 2206 2206 } 2207 2207 2208 $concat = trim( $wp_scripts->concat, ', ' ); 2209 $type_attr = current_theme_supports( 'html5', 'script' ) ? '' : " type='text/javascript'"; 2208 $concat = trim( $wp_scripts->concat, ', ' ); 2210 2209 2211 2210 if ( $concat ) { 2212 2211 if ( ! empty( $wp_scripts->print_code ) ) { 2213 echo "\n<script {$type_attr}>\n";2212 echo "\n<script>\n"; 2214 2213 echo "/* <![CDATA[ */\n"; // Not needed in HTML 5. 2215 2214 echo $wp_scripts->print_code; … … 2227 2226 2228 2227 $src = $wp_scripts->base_url . "/wp-admin/load-scripts.php?c={$zip}" . $concatenated . '&ver=' . $wp_scripts->default_version; 2229 echo "<script {$type_attr}src='" . esc_attr( $src ) . "'></script>\n";2228 echo "<script src='" . esc_attr( $src ) . "'></script>\n"; 2230 2229 } 2231 2230 … … 2399 2398 } 2400 2399 2401 $concat = trim( $wp_styles->concat, ', ' ); 2402 $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"'; 2400 $concat = trim( $wp_styles->concat, ', ' ); 2403 2401 2404 2402 if ( $concat ) { … … 2415 2413 2416 2414 $href = $wp_styles->base_url . "/wp-admin/load-styles.php?c={$zip}&dir={$dir}" . $concatenated . '&ver=' . $ver; 2417 echo "<link rel='stylesheet' href='" . esc_attr( $href ) . "' {$type_attr}media='all' />\n";2415 echo "<link rel='stylesheet' href='" . esc_attr( $href ) . "' media='all' />\n"; 2418 2416 2419 2417 if ( ! empty( $wp_styles->print_code ) ) { 2420 echo "<style {$type_attr}>\n";2418 echo "<style>\n"; 2421 2419 echo $wp_styles->print_code; 2422 2420 echo sprintf( "\n/*# sourceURL=%s */", rawurlencode( $concat_source_url ) ); … … 2906 2904 */ 2907 2905 function wp_get_script_tag( $attributes ) { 2908 if ( ! isset( $attributes['type'] ) && ! is_admin() && ! current_theme_supports( 'html5', 'script' ) ) {2909 // Keep the type attribute as the first for legacy reasons (it has always been this way in core).2910 $attributes = array_merge(2911 array( 'type' => 'text/javascript' ),2912 $attributes2913 );2914 }2915 2906 /** 2916 2907 * Filters attributes to be added to a script tag. … … 2954 2945 */ 2955 2946 function wp_get_inline_script_tag( $data, $attributes = array() ) { 2956 $is_html5 = current_theme_supports( 'html5', 'script' ) || is_admin();2957 if ( ! isset( $attributes['type'] ) && ! $is_html5 ) {2958 // Keep the type attribute as the first for legacy reasons (it has always been this way in core).2959 $attributes = array_merge(2960 array( 'type' => 'text/javascript' ),2961 $attributes2962 );2963 }2964 2965 2947 /* 2966 2948 * XHTML extracts the contents of the SCRIPT element and then the XML parser … … 2988 2970 */ 2989 2971 if ( 2990 ! $is_html5&&2972 ! current_theme_supports( 'html5', 'script' ) && 2991 2973 ( 2992 2974 ! isset( $attributes['type'] ) ||
Note: See TracChangeset
for help on using the changeset viewer.