WP_REST_Search_Handler::prepare_item_links() WordPress Method
The prepare_item_links() method is used to prepare the links for each search item. This method is called by the search() method.
WP_REST_Search_Handler::prepare_item_links( int|string $id ) #
Prepares links for the search result of a given ID.
Contents
Parameters
- $id
(int|string)(Required)Item ID.
Return
(array) Links for the given item.
Source
File: wp-includes/rest-api/search/class-wp-rest-search-handler.php
abstract public function prepare_item_links( $id );
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
5.6.0 | The $id parameter can accept a string. |
5.0.0 | Introduced. |