[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/rest-api/search/ -> class-wp-rest-post-search-handler.php (summary)

REST API: WP_REST_Post_Search_Handler class

File Size: 197 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

WP_REST_Post_Search_Handler:: (6 methods):
  __construct()
  search_items()
  prepare_item()
  prepare_item_links()
  protected_title_format()
  detect_rest_item_route()


Class: WP_REST_Post_Search_Handler  - X-Ref

Core class representing a search handler for posts in the REST API.

__construct()   X-Ref
Constructor.

since: 5.0.0

search_items( WP_REST_Request $request )   X-Ref
Searches the object type content for a given search request.

return: array Associative array containing an `WP_REST_Search_Handler::RESULT_IDS` containing
param: WP_REST_Request $request Full REST request.
since: 5.0.0

prepare_item( $id, array $fields )   X-Ref
Prepares the search result for a given ID.

return: array Associative array containing all fields for the item.
param: int   $id     Item ID.
param: array $fields Fields to include for the item.
since: 5.0.0

prepare_item_links( $id )   X-Ref
Prepares links for the search result of a given ID.

return: array Links for the given item.
param: int $id Item ID.
since: 5.0.0

protected_title_format()   X-Ref
Overwrites the default protected title format.

By default, WordPress will show password protected posts with a title of
"Protected: %s". As the REST API communicates the protected status of a post
in a machine readable format, we remove the "Protected: " prefix.

return: string Protected title format.
since: 5.0.0

detect_rest_item_route( $post )   X-Ref
Attempts to detect the route to access a single item.

return: string REST route relative to the REST base URI, or empty string if unknown.
param: WP_Post $post Post object.
since: 5.0.0



Generated: Sat Nov 23 01:00:02 2024 Cross-referenced by PHPXref 0.7.1