wp_rest_search_handlers WordPress Filter Hook
This hook allows you to modify the search handlers used by the WP REST API. By default, the WP REST API uses the built-in WordPress search engine to power its search functionality. However, you may want to use a different search engine, such as Elasticsearch, to power your search. This hook gives you the ability to modify the search handlers used by the WP REST API. You can use this hook to switch to a different search engine, such as Elasticsearch. This will give you more power and flexibility when it comes to searching your site.
apply_filters( 'wp_rest_search_handlers', array $search_handlers ) #
Filters the search handlers to use in the REST search controller.
Parameters
- $search_handlers
(array)List of search handlers to use in the controller. Each search handler instance must extend the
WP_REST_Search_Handler
class. Default is only a handler for posts.
Source
File: wp-includes/rest-api.php
Changelog
Version | Description |
---|---|
5.0.0 | Introduced. |