Skip to content

Commit

Permalink
🐛 remove wp_ob_end_flush_all from shutdown action
Browse files Browse the repository at this point in the history
  • Loading branch information
QWp6t committed Jan 30, 2024
1 parent 837d5e0 commit ae5f68d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Roots/Acorn/Bootloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,14 @@ protected function registerWordPressRoute(ApplicationContract $app)
$response->header($header, $value);
}

$response->setContent(ob_get_clean());
$content = '';

$levels = ob_get_level();
for ( $i = 0; $i < $levels; $i++ ) {
$content .= ob_get_clean();
}

$response->setContent($content);
}))
->where('any', '.*')
->name('wordpress_request');
Expand Down Expand Up @@ -272,7 +279,8 @@ protected function registerRequestHandler(

ob_start();

add_action('shutdown', fn () => $this->handleRequest($kernel, $request), PHP_INT_MAX);
remove_action('shutdown', 'wp_ob_end_flush_all', 1);
add_action('shutdown', fn () => $this->handleRequest($kernel, $request), 100);
}

/**
Expand Down

0 comments on commit ae5f68d

Please sign in to comment.