Skip to content

Commit

Permalink
fix: jetpack search initializer blog id
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
miguelpeixe authored Oct 9, 2024
1 parent 08b4140 commit 623f987
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion adapters/jetpack-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 623f987

Please sign in to comment.