| [ Index ] | PHP Cross Reference of WordPress Trunk (Updated Daily) | 
[Source view] [Print] [Project Stats]
REST API: WP_REST_Post_Search_Handler class
| File Size: | 217 lines (6 kb) | 
| Included or required: | 0 times | 
| Referenced: | 0 times | 
| Includes or requires: | 0 files | 
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. | 
| search_items( WP_REST_Request $request ) X-Ref | 
| Searches posts for a given search request. param: WP_REST_Request $request Full REST request. return: array { | 
| prepare_item( $id, array $fields ) X-Ref | 
| Prepares the search result for a given post ID. param: int $id Post ID. param: array $fields Fields to include for the post. return: array { | 
| prepare_item_links( $id ) X-Ref | 
| Prepares links for the search result of a given ID. param: int $id Item ID. return: array Links for the given item. | 
| protected_title_format() X-Ref | 
| Overwrites the default protected and private title format. By default, WordPress will show password protected or private posts with a title of "Protected: %s" or "Private: %s", as the REST API communicates the status of a post in a machine-readable format, we remove the prefix. return: string Title format. | 
| detect_rest_item_route( $post ) X-Ref | 
| Attempts to detect the route to access a single item. param: WP_Post $post Post object. return: string REST route relative to the REST base URI, or empty string if unknown. | 
| Generated : Thu Oct 30 08:20:06 2025 | Cross-referenced by PHPXref |