wp/wp-includes/rest-api/search/class-wp-rest-search-handler.php
changeset 18 be944660c56a
parent 9 177826044cd9
child 21 48c4eec2b7e6
equal deleted inserted replaced
17:34716fd837a4 18:be944660c56a
    76 
    76 
    77 	/**
    77 	/**
    78 	 * Prepares the search result for a given ID.
    78 	 * Prepares the search result for a given ID.
    79 	 *
    79 	 *
    80 	 * @since 5.0.0
    80 	 * @since 5.0.0
       
    81 	 * @since 5.6.0 The `$id` parameter can accept a string.
    81 	 *
    82 	 *
    82 	 * @param int   $id     Item ID.
    83 	 * @param int|string $id     Item ID.
    83 	 * @param array $fields Fields to include for the item.
    84 	 * @param array      $fields Fields to include for the item.
    84 	 * @return array Associative array containing all fields for the item.
    85 	 * @return array Associative array containing all fields for the item.
    85 	 */
    86 	 */
    86 	abstract public function prepare_item( $id, array $fields );
    87 	abstract public function prepare_item( $id, array $fields );
    87 
    88 
    88 	/**
    89 	/**
    89 	 * Prepares links for the search result of a given ID.
    90 	 * Prepares links for the search result of a given ID.
    90 	 *
    91 	 *
    91 	 * @since 5.0.0
    92 	 * @since 5.0.0
       
    93 	 * @since 5.6.0 The `$id` parameter can accept a string.
    92 	 *
    94 	 *
    93 	 * @param int $id Item ID.
    95 	 * @param int|string $id Item ID.
    94 	 * @return array Links for the given item.
    96 	 * @return array Links for the given item.
    95 	 */
    97 	 */
    96 	abstract public function prepare_item_links( $id );
    98 	abstract public function prepare_item_links( $id );
    97 }
    99 }