From c33bd59a22051d4dbbdce452e9099d9e00c7a0cd Mon Sep 17 00:00:00 2001 From: Iain Date: Wed, 25 May 2022 22:45:05 +0100 Subject: [PATCH] Manually run query_posts if Cortex is booted, as it is no longer run in WP::main() from WordPress 6.0 --- src/Cortex.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Cortex.php b/src/Cortex.php index 0bb7342..b0340bc 100644 --- a/src/Cortex.php +++ b/src/Cortex.php @@ -65,6 +65,10 @@ public static function boot(RequestInterface $request = null) $do = $instance->doBoot($wp, $do, $request); unset($instance); + if ( ! $do ) { + $wp->query_posts(); + } + return $do; } catch (\Exception $e) { if (defined('WP_DEBUG') && WP_DEBUG) {