WP_REST_Search_Handler::search_items() WordPress Method

The WP_REST_Search_Handler::search_items() method is used to search for items in a WordPress installation. The search is performed against the WordPress database and any results are returned as an array of items.

WP_REST_Search_Handler::search_items( WP_REST_Request $request ) #

Searches the object type content for a given search request.


Parameters

$request

(WP_REST_Request)(Required)Full REST request.


Top ↑

Return

(array) Associative array containing an WP_REST_Search_Handler::RESULT_IDS containing an array of found IDs and WP_REST_Search_Handler::RESULT_TOTAL containing the total count for the matching search results.


Top ↑

Source

File: wp-includes/rest-api/search/class-wp-rest-search-handler.php

	abstract public function search_items( WP_REST_Request $request );

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.