Make WordPress Core


Ignore:
Timestamp:
02/16/2024 09:33:02 PM (15 months ago)
Author:
johnbillion
Message:

REST API: Clarify documentation for methods and filters relating to REST API search endpoints.

See #59651

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/search/class-wp-rest-term-search-handler.php

    r54123 r57643  
    3737
    3838    /**
    39      * Searches the object type content for a given search request.
     39     * Searches terms for a given search request.
    4040     *
    4141     * @since 5.6.0
     
    4545     *     Associative array containing found IDs and total count for the matching search results.
    4646     *
    47      *     @type int[]               $ids   Found IDs.
     47     *     @type int[]               $ids   Found term IDs.
    4848     *     @type string|int|WP_Error $total Numeric string containing the number of terms in that
    4949     *                                      taxonomy, 0 if there are no results, or WP_Error if
     
    8080
    8181        /**
    82          * Filters the query arguments for a REST API search request.
     82         * Filters the query arguments for a REST API term search request.
    8383         *
    8484         * Enables adding extra arguments or setting defaults for a term search request.
     
    111111
    112112    /**
    113      * Prepares the search result for a given ID.
     113     * Prepares the search result for a given term ID.
    114114     *
    115115     * @since 5.6.0
    116116     *
    117      * @param int   $id     Item ID.
    118      * @param array $fields Fields to include for the item.
    119      * @return array Associative array containing all fields for the item.
     117     * @param int   $id     Term ID.
     118     * @param array $fields Fields to include for the term.
     119     * @return array {
     120     *     Associative array containing fields for the term based on the `$fields` parameter.
     121     *
     122     *     @type int    $id    Optional. Term ID.
     123     *     @type string $title Optional. Term name.
     124     *     @type string $url   Optional. Term permalink URL.
     125     *     @type string $type  Optional. Term taxonomy name.
     126     * }
    120127     */
    121128    public function prepare_item( $id, array $fields ) {
Note: See TracChangeset for help on using the changeset viewer.