Docs: Corrections and improvements to inline docs relating to the REST API.

See #50768

Built from https://develop.svn.wordpress.org/trunk@49610


git-svn-id: http://core.svn.wordpress.org/trunk@49348 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2020-11-16 11:04:12 +00:00
parent b51eeb4eef
commit 753ae723ad
10 changed files with 23 additions and 23 deletions

View File

@ -10,7 +10,7 @@
/** /**
* oEmbed API endpoint controller. * oEmbed API endpoint controller.
* *
* Registers the API route and delivers the response data. * Registers the REST API route and delivers the response data.
* The output format (XML or JSON) is handled by the REST API. * The output format (XML or JSON) is handled by the REST API.
* *
* @since 4.4.0 * @since 4.4.0

View File

@ -130,7 +130,7 @@ function register_rest_route( $namespace, $route, $args = array(), $override = f
* @type callable|null $update_callback Optional. The callback function used to set and update the field value. Default * @type callable|null $update_callback Optional. The callback function used to set and update the field value. Default
* is 'null', the value cannot be set or updated. The function will be passed * is 'null', the value cannot be set or updated. The function will be passed
* the model object, like WP_Post. * the model object, like WP_Post.
* @type array|null $schema Optional. The callback function used to create the schema for this field. * @type array|null $schema Optional. The schema for this field.
* Default is 'null', no schema entry will be returned. * Default is 'null', no schema entry will be returned.
* } * }
*/ */
@ -153,7 +153,7 @@ function register_rest_field( $object_type, $attribute, $args = array() ) {
} }
/** /**
* Registers rewrite rules for the API. * Registers rewrite rules for the REST API.
* *
* @since 4.4.0 * @since 4.4.0
* *
@ -498,7 +498,7 @@ function rest_get_server() {
/** /**
* Filters the REST Server Class. * Filters the REST Server Class.
* *
* This filter allows you to adjust the server class used by the API, using a * This filter allows you to adjust the server class used by the REST API, using a
* different class to handle requests. * different class to handle requests.
* *
* @since 4.4.0 * @since 4.4.0
@ -509,7 +509,7 @@ function rest_get_server() {
$wp_rest_server = new $wp_rest_server_class; $wp_rest_server = new $wp_rest_server_class;
/** /**
* Fires when preparing to serve an API request. * Fires when preparing to serve a REST API request.
* *
* Endpoint objects should be created and register their hooks on this action rather * Endpoint objects should be created and register their hooks on this action rather
* than another action to ensure they're only loaded when needed. * than another action to ensure they're only loaded when needed.
@ -802,7 +802,7 @@ function _rest_array_intersect_key_recursive( $array1, $array2 ) {
} }
/** /**
* Filters the API response to include only a white-listed set of response object fields. * Filters the REST API response to include only a white-listed set of response object fields.
* *
* @since 4.8.0 * @since 4.8.0
* *

View File

@ -262,7 +262,7 @@ class WP_REST_Response extends WP_HTTP_Response {
); );
/** /**
* Filters extra CURIEs available on API responses. * Filters extra CURIEs available on REST API responses.
* *
* CURIEs allow a shortened version of URI relations. This allows a more * CURIEs allow a shortened version of URI relations. This allows a more
* usable form for custom relations than using the full URI. These work * usable form for custom relations than using the full URI. These work
@ -284,7 +284,7 @@ class WP_REST_Response extends WP_HTTP_Response {
* *
* @since 4.5.0 * @since 4.5.0
* *
* @param array $additional Additional CURIEs to register with the API. * @param array $additional Additional CURIEs to register with the REST API.
*/ */
$additional = apply_filters( 'rest_response_link_curies', array() ); $additional = apply_filters( 'rest_response_link_curies', array() );

View File

@ -259,7 +259,7 @@ class WP_REST_Server {
} }
/** /**
* Handles serving an API request. * Handles serving a REST API request.
* *
* Matches the current server URI to a route and runs the first matching * Matches the current server URI to a route and runs the first matching
* callback then outputs a JSON representation of the returned value. * callback then outputs a JSON representation of the returned value.
@ -286,7 +286,7 @@ class WP_REST_Server {
* *
* This is done because for authentications such as Application * This is done because for authentications such as Application
* Passwords, we don't want it to be accepted unless the current HTTP * Passwords, we don't want it to be accepted unless the current HTTP
* request is an API request, which can't always be identified early * request is a REST API request, which can't always be identified early
* enough in evaluation. * enough in evaluation.
*/ */
$current_user = null; $current_user = null;
@ -367,7 +367,7 @@ class WP_REST_Server {
* *
* @since 4.4.0 * @since 4.4.0
* @deprecated 4.7.0 Use the {@see 'rest_authentication_errors'} filter to * @deprecated 4.7.0 Use the {@see 'rest_authentication_errors'} filter to
* restrict access to the API. * restrict access to the REST API.
* *
* @param bool $rest_enabled Whether the REST API is enabled. Default true. * @param bool $rest_enabled Whether the REST API is enabled. Default true.
*/ */
@ -449,14 +449,14 @@ class WP_REST_Server {
} }
/** /**
* Filters the API response. * Filters the REST API response.
* *
* Allows modification of the response before returning. * Allows modification of the response before returning.
* *
* @since 4.4.0 * @since 4.4.0
* @since 4.5.0 Applied to embedded responses. * @since 4.5.0 Applied to embedded responses.
* *
* @param WP_HTTP_Response $result Result to send to the client. Usually a WP_REST_Response. * @param WP_HTTP_Response $result Result to send to the client. Usually a `WP_REST_Response`.
* @param WP_REST_Server $this Server instance. * @param WP_REST_Server $this Server instance.
* @param WP_REST_Request $request Request used to generate the response. * @param WP_REST_Request $request Request used to generate the response.
*/ */
@ -475,7 +475,7 @@ class WP_REST_Server {
$this->set_status( $code ); $this->set_status( $code );
/** /**
* Filters whether the request has already been served. * Filters whether the REST API request has already been served.
* *
* Allow sending the request manually - by returning true, the API result * Allow sending the request manually - by returning true, the API result
* will not be sent to the client. * will not be sent to the client.
@ -484,7 +484,7 @@ class WP_REST_Server {
* *
* @param bool $served Whether the request has already been served. * @param bool $served Whether the request has already been served.
* Default false. * Default false.
* @param WP_HTTP_Response $result Result to send to the client. Usually a WP_REST_Response. * @param WP_HTTP_Response $result Result to send to the client. Usually a `WP_REST_Response`.
* @param WP_REST_Request $request Request used to generate the response. * @param WP_REST_Request $request Request used to generate the response.
* @param WP_REST_Server $this Server instance. * @param WP_REST_Server $this Server instance.
*/ */
@ -500,7 +500,7 @@ class WP_REST_Server {
$result = $this->response_to_data( $result, $embed ); $result = $this->response_to_data( $result, $embed );
/** /**
* Filters the API response. * Filters the REST API response.
* *
* Allows modification of the response data after inserting * Allows modification of the response data after inserting
* embedded data (if any) and before echoing the response data. * embedded data (if any) and before echoing the response data.
@ -1248,7 +1248,7 @@ class WP_REST_Server {
$response->add_link( 'help', 'http://v2.wp-api.org/' ); $response->add_link( 'help', 'http://v2.wp-api.org/' );
/** /**
* Filters the API root index data. * Filters the REST API root index data.
* *
* This contains the data describing the API. This includes information * This contains the data describing the API. This includes information
* about supported authentication schemes, supported namespaces, routes * about supported authentication schemes, supported namespaces, routes

View File

@ -425,7 +425,7 @@ class WP_REST_Autosaves_Controller extends WP_REST_Revisions_Controller {
$response->data = $this->filter_response_by_context( $response->data, $context ); $response->data = $this->filter_response_by_context( $response->data, $context );
/** /**
* Filters a revision returned from the API. * Filters a revision returned from the REST API.
* *
* Allows modification of the revision right before it is returned. * Allows modification of the revision right before it is returned.
* *

View File

@ -1120,7 +1120,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
$response->add_links( $this->prepare_links( $comment ) ); $response->add_links( $this->prepare_links( $comment ) );
/** /**
* Filters a comment returned from the API. * Filters a comment returned from the REST API.
* *
* Allows modification of the comment right before it is returned. * Allows modification of the comment right before it is returned.
* *

View File

@ -241,7 +241,7 @@ class WP_REST_Post_Types_Controller extends WP_REST_Controller {
); );
/** /**
* Filters a post type returned from the API. * Filters a post type returned from the REST API.
* *
* Allows modification of the post type data right before it is returned. * Allows modification of the post type data right before it is returned.
* *

View File

@ -621,7 +621,7 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
} }
/** /**
* Filters a revision returned from the API. * Filters a revision returned from the REST API.
* *
* Allows modification of the revision right before it is returned. * Allows modification of the revision right before it is returned.
* *

View File

@ -828,7 +828,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
$response->add_links( $this->prepare_links( $item ) ); $response->add_links( $this->prepare_links( $item ) );
/** /**
* Filters a term item returned from the API. * Filters a term item returned from the REST API.
* *
* The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug. * The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug.
* *

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.6-beta4-49609'; $wp_version = '5.6-beta4-49610';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.