wp-search-with-algolia icon indicating copy to clipboard operation
wp-search-with-algolia copied to clipboard

Add filter to potentially override Autocomplete enabled status.

Open tw2113 opened this issue 3 years ago • 2 comments

We have should_override_search_with_instantsearch() in class Algolia_Settings and I think it would be useful to have a matching version for Autocomplete.

public function should_override_search_with_instantsearch() {
	$value = $this->get_override_native_search() === 'instantsearch';

	return (bool) apply_filters( 'algolia_should_override_search_with_instantsearch', $value );
}

I am seeing support requests where users want to use the functionality only in some places of their website, and not globally. The filter above covers instantsearch, but not autocomplete.

tw2113 avatar Jun 08 '22 16:06 tw2113

@tw2113

I am seeing support requests where users want to use the functionality only in some places of their website, and not globally.

I am assuming by this, you mean that the users want to enable the autocomplete on some specific pages or locations and disable on the rest?

asharirfan avatar Oct 19 '22 20:10 asharirfan

I believe so, yes. Allow the ability to filter a boolean value conditionally, much like one could with the existing code above.

tw2113 avatar Oct 19 '22 20:10 tw2113

Closing as handled in #245

tw2113 avatar Oct 27 '22 21:10 tw2113