diff --git src/wp-includes/script-loader.php src/wp-includes/script-loader.php
index b21f9a6f49..9316d70811 100644
|
|
|
function wp_get_script_polyfill( &$scripts, $tests ) { |
| 178 | 178 | continue; |
| 179 | 179 | } |
| 180 | 180 | |
| | 181 | $src = $scripts->registered[ $handle ]->src; |
| | 182 | $ver = $scripts->registered[ $handle ]->ver; |
| | 183 | |
| | 184 | if ( ! preg_match( '|^(https?:)?//|', $src ) && ! ( $scripts->content_url && 0 === strpos( $src, $scripts->content_url ) ) ) { |
| | 185 | $src = $scripts->base_url . $src; |
| | 186 | } |
| | 187 | |
| | 188 | if ( ! empty( $ver ) ) { |
| | 189 | $src = add_query_arg( 'ver', $ver, $src ); |
| | 190 | } |
| | 191 | |
| | 192 | /** This filter is documented in wp-includes/class.wp-scripts.php */ |
| | 193 | $src = esc_url( apply_filters( 'script_loader_src', $src, $handle ) ); |
| | 194 | |
| | 195 | if ( ! $src ) { |
| | 196 | continue; |
| | 197 | } |
| | 198 | |
| 181 | 199 | $polyfill .= ( |
| 182 | 200 | // Test presence of feature... |
| 183 | 201 | '( ' . $test . ' ) || ' . |
| … |
… |
function wp_get_script_polyfill( &$scripts, $tests ) { |
| 185 | 203 | // at the `document.write`. Its caveat of synchronous mid-stream |
| 186 | 204 | // blocking write is exactly the behavior we need though. |
| 187 | 205 | 'document.write( \'<script src="' . |
| 188 | | esc_url( $scripts->registered[ $handle ]->src ) . |
| | 206 | $src . |
| 189 | 207 | '"></scr\' + \'ipt>\' );' |
| 190 | 208 | ); |
| 191 | 209 | } |