From f5863b34fea2e56e7fa43fd17dcde0b730321286 Mon Sep 17 00:00:00 2001 From: codejp3 Date: Mon, 14 Nov 2022 21:47:02 -0500 Subject: [PATCH] patched: WP 6.0+ broken queries WP changed how they format and pass the $sql var to the posts_requests hook (and probably elsewhere too). Added a preg_replace line to remove multiple spaces/tabs and replace with single spaces so the str_replace functions work properly. --- index.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.php b/index.php index 2369319..eac7f0d 100644 --- a/index.php +++ b/index.php @@ -82,6 +82,8 @@ function posts_clauses($clauses, $query) { } function posts_request($sql, $query) { + + $sql = preg_replace('/\s+/', " ", $sql); if($query->get('multisite')) {