Make WordPress Core


Ignore:
Timestamp:
01/10/2021 10:21:39 PM (4 years ago)
Author:
johnbillion
Message:

REST API: Corrections and improvements to docblocks for REST API filters.

See #51800

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/class-wp-rest-server.php

    r49946 r49955  
    163163    public function check_authentication() {
    164164        /**
    165          * Filters REST authentication errors.
     165         * Filters REST API authentication errors.
    166166         *
    167167         * This is used to pass a WP_Error from an authentication method back to
     
    311311
    312312        /**
    313          * Filters the list of response headers that are exposed to CORS requests.
     313         * Filters the list of response headers that are exposed to REST API CORS requests.
    314314         *
    315315         * @since 5.5.0
    316316         *
    317          * @param string[] $expose_headers The list of headers to expose.
     317         * @param string[] $expose_headers The list of response headers to expose.
    318318         */
    319319        $expose_headers = apply_filters( 'rest_exposed_cors_headers', $expose_headers );
     
    330330
    331331        /**
    332          * Filters the list of request headers that are allowed for CORS requests.
     332         * Filters the list of request headers that are allowed for REST API CORS requests.
    333333         *
    334334         * The allowed headers are passed to the browser to specify which
     
    339339         * @since 5.5.0
    340340         *
    341          * @param string[] $allow_headers The list of headers to allow.
     341         * @param string[] $allow_headers The list of request headers to allow.
    342342         */
    343343        $allow_headers = apply_filters( 'rest_allowed_cors_headers', $allow_headers );
     
    346346
    347347        /**
    348          * Send nocache headers on authenticated requests.
     348         * Filters whether to send nocache headers on a REST API request.
    349349         *
    350350         * @since 4.4.0
     
    385385
    386386        /**
    387          * Filters whether jsonp is enabled.
     387         * Filters whether JSONP is enabled for the REST API.
    388388         *
    389389         * @since 4.4.0
    390390         *
    391          * @param bool $jsonp_enabled Whether jsonp is enabled. Default true.
     391         * @param bool $jsonp_enabled Whether JSONP is enabled. Default true.
    392392         */
    393393        $jsonp_enabled = apply_filters( 'rest_jsonp_enabled', true );
     
    769769
    770770        /**
    771          * Filters the enveloped form of a response.
     771         * Filters the enveloped form of a REST API response.
    772772         *
    773773         * @since 4.4.0
    774774         *
    775          * @param array            $envelope Envelope data.
     775         * @param array            $envelope {
     776         *     Envelope data.
     777         *
     778         *     @type array $body    Response data.
     779         *     @type int   $status  The 3-digit HTTP status code.
     780         *     @type array $headers Map of header name to header value.
     781         * }
    776782         * @param WP_REST_Response $response Original response data.
    777783         */
     
    858864
    859865        /**
    860          * Filters the array of available endpoints.
     866         * Filters the array of available REST API endpoints.
    861867         *
    862868         * @since 4.4.0
     
    958964    public function dispatch( $request ) {
    959965        /**
    960          * Filters the pre-calculated result of a REST dispatch request.
     966         * Filters the pre-calculated result of a REST API dispatch request.
    961967         *
    962968         * Allow hijacking the request before dispatching by returning a non-empty. The returned value
     
    11171123         * @since 4.7.0
    11181124         *
    1119          * @param WP_REST_Response|WP_HTTP_Response|WP_Error|mixed $response Result to send to the client. Usually a WP_REST_Response or WP_Error.
     1125         * @param WP_REST_Response|WP_HTTP_Response|WP_Error|mixed $response Result to send to the client.
     1126         *                                                                   Usually a WP_REST_Response or WP_Error.
    11201127         * @param array                                            $handler  Route handler used for the request.
    11211128         * @param WP_REST_Request                                  $request  Request used to generate the response.
     
    11401147        if ( ! is_wp_error( $response ) ) {
    11411148            /**
    1142              * Filters the REST dispatch request result.
     1149             * Filters the REST API dispatch request result.
    11431150             *
    11441151             * Allow plugins to override dispatching the request.
     
    11781185         * @since 4.7.0
    11791186         *
    1180          * @param WP_REST_Response|WP_HTTP_Response|WP_Error|mixed $response Result to send to the client. Usually a WP_REST_Response or WP_Error.
     1187         * @param WP_REST_Response|WP_HTTP_Response|WP_Error|mixed $response Result to send to the client.
     1188         *                                                                   Usually a WP_REST_Response or WP_Error.
    11811189         * @param array                                            $handler  Route handler used for the request.
    11821190         * @param WP_REST_Request                                  $request  Request used to generate the response.
     
    13241332
    13251333        /**
    1326          * Filters the namespace index data.
     1334         * Filters the REST API namespace index data.
    13271335         *
    13281336         * This typically is just the route data for the namespace, but you can
     
    13571365
    13581366            /**
    1359              * Filters the REST endpoint data.
     1367             * Filters the REST API endpoint data.
    13601368             *
    13611369             * @since 4.4.0
     
    13671375
    13681376        /**
    1369          * Filters the publicly-visible data for routes.
     1377         * Filters the publicly-visible data for REST API routes.
    13701378         *
    13711379         * This data is exposed on indexes and can be used by clients or
     
    14671475    protected function get_max_batch_size() {
    14681476        /**
    1469          * Filters the maximum number of requests that can be included in a batch.
     1477         * Filters the maximum number of REST API requests that can be included in a batch.
    14701478         *
    14711479         * @since 5.6.0
Note: See TracChangeset for help on using the changeset viewer.