From 0331674afc0575f4ac53a573a2ec988e9eb2377f Mon Sep 17 00:00:00 2001 From: Siddharth Thevaril Date: Sun, 1 Mar 2026 23:45:24 +0530 Subject: [PATCH] Fix search template generation when Post Search feature is disabled --- includes/classes/Feature/InstantResults/InstantResults.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/classes/Feature/InstantResults/InstantResults.php b/includes/classes/Feature/InstantResults/InstantResults.php index ebf598596..28dc34ffa 100644 --- a/includes/classes/Feature/InstantResults/InstantResults.php +++ b/includes/classes/Feature/InstantResults/InstantResults.php @@ -170,6 +170,11 @@ public function requirements_status() { * @return void */ public function setup() { + // Activate the post indexable so query integration hooks are registered. + // Without this, get_search_template() falls back to MySQL when the + // Post Search feature is disabled, resulting in an empty template. + Indexables::factory()->activate( 'post' ); + add_filter( 'ep_after_update_feature', [ $this, 'after_update_feature' ], 10, 3 ); add_filter( 'ep_formatted_args', [ $this, 'maybe_apply_aggs_args' ], 10, 3 ); add_filter( 'ep_post_mapping', [ $this, 'add_mapping_properties' ] );