This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: results page override functionality on other pages

Home Forums Product Support Forums Ajax Search Pro for WordPress Support results page override functionality on other pages Reply To: results page override functionality on other pages

#38858
Ernest MarcinkoErnest Marcinko
Keymaster

Hi Martin,

In theory it might be possible. There is a non-documented hook called asp_query_is_search, which is executed right before the plugin executes the override. If the hook returns a boolean true, the it will override.

Using a custom code like this:

add_filter('asp_query_is_search', 'asp_force_override_on_conditions', 9999, 2);
function asp_force_override_on_conditions($is_search, $wp_query) {
	return true;
}

..will enable override in all query cases. However, that is probably not what you want, you may want to check certain conditions of your own. The search override hook is applied on the posts_results and posts_request wordpress core hooks.