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.


Top ↑

Source

File: wp-includes/rest-api.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More