From 2f3bcd3aa703ee8936f4d7d06078fa1ddb428048 Mon Sep 17 00:00:00 2001 From: nigrosimone Date: Mon, 20 Feb 2017 21:01:31 +0100 Subject: [PATCH] 0.9.5.x missed to implement W3TC-include-js-head (0.9.4.x's feature) --- Minify_Plugin.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Minify_Plugin.php b/Minify_Plugin.php index c30bd48..56f2d9f 100644 --- a/Minify_Plugin.php +++ b/Minify_Plugin.php @@ -1591,6 +1591,16 @@ private function flush_collected( $last_script_tag ) { // find embed position $embed_pos = $this->embed_pos; + + if ( $this->minify_group_number <= 0 && $this->group_type == 'head' ) { + // try forced embed position + $forced_embed_pos = strpos($this->buffer, ''); + + if ($forced_embed_pos !== false) { + $this->buffer = str_replace('', '', $this->buffer); + $embed_pos = $forced_embed_pos; + } + } // build minified script tag $data = array(