Update:
I can see the jQuery that generates the drop downs:
/* Setup dropdown menus */
jQuery("input[name='s']:not('.no-autocomplete')").each(function (i) {
Are there any filters or hooks available to change name=’s’? I have a custom search that uses name=’keywords’. I’d like to avoid editing core code to achieve this.
Thanks
Hi there,
Thanks for submitting this.
I think we could easily add a filter to allow you to change this.
I opened an issue here to track it: https://github.com/algolia/algoliasearch-wordpress/issues/616
Would that work for you?
Best,
@rayrutjes
Thanks!
That works perfectly for me 😀
This is now available in version 2.4.0.
You can use the algolia_autocomplete_input_selector filter hook and return your custom jQuery selector.
Let me know if that doesn’t work for you. Make sure you use the latest version.
@rayrutjes
Thanks!
So like this? …
add_filter('algolia_autocomplete_input_selector', "input[name='search_keywords']:not('.no-autocomplete')");
I would write the following:
add_filter('algolia_autocomplete_input_selector', function() {
return "input[name='search_keywords']";
});
Let me know if that works for you.
-
This reply was modified 8 years, 11 months ago by
rayrutjes.
Thanks that has done the trick 🙂