Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

Commit

Permalink
fix(injector): clean ob up to the initial level
Browse files Browse the repository at this point in the history
  • Loading branch information
DAreRodz committed Feb 6, 2020
1 parent 2cfc77f commit a53e34d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion includes/class-frontity-injector.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class Frontity_Injector
static protected $should_inject;
static protected $injection_type;
static protected $injector_string;
static protected $ob_initial_level = 0;

function __construct()
{
Expand Down Expand Up @@ -84,6 +85,7 @@ function generate_injector_string()
// Start storing in the buffer the header html.
function buffer_header_html()
{
self::$ob_initial_level = ob_get_level();
ob_start();
}

Expand All @@ -93,7 +95,7 @@ function render_header_html()
{
$header_html = '';

while (ob_get_level()) {
while (ob_get_level() > self::$ob_initial_level) {
$header_html .= ob_get_clean();
}

Expand Down

0 comments on commit a53e34d

Please sign in to comment.