From 623f987da1392f7cb064749e2d49428451520045 Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Wed, 9 Oct 2024 14:31:29 -0300 Subject: [PATCH] fix: jetpack search initializer blog id The expected value for the classic search initializer is the site's wpcom ID, not its multisite blog ID. The issue only appears when Jetpack's Instant Search module is enabled, which prevents the Classic_Search singleton from being first initialized. When initializing through the ES_WP_Query it's misconfigured and fails to perform requests. --- adapters/jetpack-search.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adapters/jetpack-search.php b/adapters/jetpack-search.php index bceb762..d94a21b 100644 --- a/adapters/jetpack-search.php +++ b/adapters/jetpack-search.php @@ -23,7 +23,7 @@ protected function query_es( $es_args ) { $jetpack_search = null; if ( class_exists( 'Automattic\Jetpack\Search\Classic_Search' ) ) { - $jetpack_search = Automattic\Jetpack\Search\Classic_Search::initialize( get_current_blog_id() ); + $jetpack_search = Automattic\Jetpack\Search\Classic_Search::initialize( \Automattic\Jetpack\Search\Helper::get_wpcom_site_id() ); } else if ( class_exists( 'Jetpack_Search' ) ) { $jetpack_search = Jetpack_Search::instance();