diff --git a/wp-includes/class.wp-scripts.php b/wp-includes/class.wp-scripts.php index ce5469e543..144bfce220 100644 --- a/wp-includes/class.wp-scripts.php +++ b/wp-includes/class.wp-scripts.php @@ -92,15 +92,6 @@ class WP_Scripts extends WP_Dependencies { */ public $print_html = ''; - /** - * HTML to print before the script handle. - * - * @since 4.5.0 - * @access public - * @var string - */ - public $print_html_before = ''; - /** * Holds inline code if concatenation is enabled. * @@ -304,11 +295,13 @@ class WP_Scripts extends WP_Dependencies { */ $srce = apply_filters( 'script_loader_src', $src, $handle ); - if ( $before_handle && ! $conditional ) { - $this->print_html_before .= $before_handle; - } + if ( $this->in_default_dir( $srce ) && ( $before_handle || $after_handle ) ) { + $this->do_concat = false; - if ( $this->in_default_dir( $srce ) && ! $conditional && ! $after_handle ) { + // Have to print the so-far concatenated scripts right away to maintain the right order. + _print_scripts(); + $this->reset(); + } elseif ( $this->in_default_dir( $srce ) && ! $conditional ) { $this->print_code .= $this->print_extra_script( $handle, false ); $this->concat .= "$handle,"; $this->concat_version .= "$handle$ver"; @@ -363,11 +356,7 @@ class WP_Scripts extends WP_Dependencies { $tag = apply_filters( 'script_loader_tag', $tag, $handle, $src ); if ( $this->do_concat ) { - if ( $after_handle ) { - $this->print_html_before .= $tag; - } else { - $this->print_html .= $tag; - } + $this->print_html .= $tag; } else { echo $tag; } @@ -592,7 +581,6 @@ class WP_Scripts extends WP_Dependencies { $this->concat = ''; $this->concat_version = ''; $this->print_html = ''; - $this->print_html_before = ''; $this->ext_version = ''; $this->ext_handles = ''; } diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index ab02bfd2eb..66080a835b 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -998,10 +998,6 @@ function _print_scripts() { echo "\n"; } - if ( ! empty( $wp_scripts->print_html_before ) ) { - echo $wp_scripts->print_html_before; - } - $concat = str_split( $concat, 128 ); $concat = 'load%5B%5D=' . implode( '&load%5B%5D=', $concat ); diff --git a/wp-includes/version.php b/wp-includes/version.php index b20973bdf7..978fa0fd5e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-RC1-37170'; +$wp_version = '4.5-RC1-37171'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.