wp/wp-includes/rest-api/search/class-wp-rest-post-format-search-handler.php
changeset 21 48c4eec2b7e6
parent 18 be944660c56a
child 22 8c2e4d02f4ef
--- a/wp/wp-includes/rest-api/search/class-wp-rest-post-format-search-handler.php	Thu Sep 29 08:06:27 2022 +0200
+++ b/wp/wp-includes/rest-api/search/class-wp-rest-post-format-search-handler.php	Fri Sep 05 18:40:08 2025 +0200
@@ -26,14 +26,17 @@
 	}
 
 	/**
-	 * Searches the object type content for a given search request.
+	 * Searches the post formats for a given search request.
 	 *
 	 * @since 5.6.0
 	 *
 	 * @param WP_REST_Request $request Full REST request.
-	 * @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.
+	 * @return array {
+	 *     Associative array containing found IDs and total count for the matching search results.
+	 *
+	 *     @type string[] $ids   Array containing slugs for the matching post formats.
+	 *     @type int      $total Total count for the matching search results.
+	 * }
 	 */
 	public function search_items( WP_REST_Request $request ) {
 		$format_strings = get_post_format_strings();
@@ -46,7 +49,7 @@
 		}
 
 		/**
-		 * Filters the query arguments for a REST API search request.
+		 * Filters the query arguments for a REST API post format search request.
 		 *
 		 * Enables adding extra arguments or setting defaults for a post format search request.
 		 *
@@ -84,13 +87,20 @@
 	}
 
 	/**
-	 * Prepares the search result for a given ID.
+	 * Prepares the search result for a given post format.
 	 *
 	 * @since 5.6.0
 	 *
 	 * @param string $id     Item ID, the post format slug.
 	 * @param array  $fields Fields to include for the item.
-	 * @return array Associative array containing all fields for the item.
+	 * @return array {
+	 *     Associative array containing fields for the post format based on the `$fields` parameter.
+	 *
+	 *     @type string $id    Optional. Post format slug.
+	 *     @type string $title Optional. Post format name.
+	 *     @type string $url   Optional. Post format permalink URL.
+	 *     @type string $type  Optional. String 'post-format'.
+	 *}
 	 */
 	public function prepare_item( $id, array $fields ) {
 		$data = array();