REST API: Update “object” strings to use the appropriate nouns.

This updates route arguments and schema descriptions to use more specific object types for clarity.

Follow-up to [39342].

Props lephleg, jnylen0.
Fixes #40720.

git-svn-id: https://develop.svn.wordpress.org/trunk@51000 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2021-05-25 13:11:55 +00:00
parent 55572ad664
commit 3d5a37a9bc
19 changed files with 93 additions and 93 deletions

View File

@ -642,7 +642,7 @@ class WP_REST_Application_Passwords_Controller extends WP_REST_Controller {
} }
/** /**
* Prepares links for the object. * Prepares links for the request.
* *
* @since 5.6.0 * @since 5.6.0
* *

View File

@ -34,7 +34,7 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller {
'permission_callback' => array( $this, 'post_process_item_permissions_check' ), 'permission_callback' => array( $this, 'post_process_item_permissions_check' ),
'args' => array( 'args' => array(
'id' => array( 'id' => array(
'description' => __( 'Unique identifier for the object.' ), 'description' => __( 'Unique identifier for the attachment.' ),
'type' => 'integer', 'type' => 'integer',
), ),
'action' => array( 'action' => array(
@ -888,12 +888,12 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller {
), ),
'properties' => array( 'properties' => array(
'raw' => array( 'raw' => array(
'description' => __( 'Description for the object, as it exists in the database.' ), 'description' => __( 'Description for the attachment, as it exists in the database.' ),
'type' => 'string', 'type' => 'string',
'context' => array( 'edit' ), 'context' => array( 'edit' ),
), ),
'rendered' => array( 'rendered' => array(
'description' => __( 'HTML description for the object, transformed for display.' ), 'description' => __( 'HTML description for the attachment, transformed for display.' ),
'type' => 'string', 'type' => 'string',
'context' => array( 'view', 'edit' ), 'context' => array( 'view', 'edit' ),
'readonly' => true, 'readonly' => true,

View File

@ -86,7 +86,7 @@ class WP_REST_Autosaves_Controller extends WP_REST_Revisions_Controller {
array( array(
'args' => array( 'args' => array(
'parent' => array( 'parent' => array(
'description' => __( 'The ID for the parent of the object.' ), 'description' => __( 'The ID for the parent of the autosave.' ),
'type' => 'integer', 'type' => 'integer',
), ),
), ),
@ -112,11 +112,11 @@ class WP_REST_Autosaves_Controller extends WP_REST_Revisions_Controller {
array( array(
'args' => array( 'args' => array(
'parent' => array( 'parent' => array(
'description' => __( 'The ID for the parent of the object.' ), 'description' => __( 'The ID for the parent of the autosave.' ),
'type' => 'integer', 'type' => 'integer',
), ),
'id' => array( 'id' => array(
'description' => __( 'The ID for the object.' ), 'description' => __( 'The ID for the autosave.' ),
'type' => 'integer', 'type' => 'integer',
), ),
), ),

View File

@ -45,7 +45,7 @@ class WP_REST_Block_Types_Controller extends WP_REST_Controller {
} }
/** /**
* Registers the routes for the objects of the controller. * Registers the routes for block types.
* *
* @since 5.5.0 * @since 5.5.0
* *

View File

@ -37,7 +37,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
} }
/** /**
* Registers the routes for the objects of the controller. * Registers the routes for comments.
* *
* @since 4.7.0 * @since 4.7.0
* *
@ -71,7 +71,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
array( array(
'args' => array( 'args' => array(
'id' => array( 'id' => array(
'description' => __( 'Unique identifier for the object.' ), 'description' => __( 'Unique identifier for the comment.' ),
'type' => 'integer', 'type' => 'integer',
), ),
), ),
@ -1381,7 +1381,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
'type' => 'object', 'type' => 'object',
'properties' => array( 'properties' => array(
'id' => array( 'id' => array(
'description' => __( 'Unique identifier for the object.' ), 'description' => __( 'Unique identifier for the comment.' ),
'type' => 'integer', 'type' => 'integer',
'context' => array( 'view', 'edit', 'embed' ), 'context' => array( 'view', 'edit', 'embed' ),
'readonly' => true, 'readonly' => true,
@ -1392,7 +1392,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
'context' => array( 'view', 'edit', 'embed' ), 'context' => array( 'view', 'edit', 'embed' ),
), ),
'author_email' => array( 'author_email' => array(
'description' => __( 'Email address for the object author.' ), 'description' => __( 'Email address for the comment author.' ),
'type' => 'string', 'type' => 'string',
'format' => 'email', 'format' => 'email',
'context' => array( 'edit' ), 'context' => array( 'edit' ),
@ -1402,13 +1402,13 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
), ),
), ),
'author_ip' => array( 'author_ip' => array(
'description' => __( 'IP address for the object author.' ), 'description' => __( 'IP address for the comment author.' ),
'type' => 'string', 'type' => 'string',
'format' => 'ip', 'format' => 'ip',
'context' => array( 'edit' ), 'context' => array( 'edit' ),
), ),
'author_name' => array( 'author_name' => array(
'description' => __( 'Display name for the object author.' ), 'description' => __( 'Display name for the comment author.' ),
'type' => 'string', 'type' => 'string',
'context' => array( 'view', 'edit', 'embed' ), 'context' => array( 'view', 'edit', 'embed' ),
'arg_options' => array( 'arg_options' => array(
@ -1416,13 +1416,13 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
), ),
), ),
'author_url' => array( 'author_url' => array(
'description' => __( 'URL for the object author.' ), 'description' => __( 'URL for the comment author.' ),
'type' => 'string', 'type' => 'string',
'format' => 'uri', 'format' => 'uri',
'context' => array( 'view', 'edit', 'embed' ), 'context' => array( 'view', 'edit', 'embed' ),
), ),
'author_user_agent' => array( 'author_user_agent' => array(
'description' => __( 'User agent for the object author.' ), 'description' => __( 'User agent for the comment author.' ),
'type' => 'string', 'type' => 'string',
'context' => array( 'edit' ), 'context' => array( 'edit' ),
'arg_options' => array( 'arg_options' => array(
@ -1430,7 +1430,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
), ),
), ),
'content' => array( 'content' => array(
'description' => __( 'The content for the object.' ), 'description' => __( 'The content for the comment.' ),
'type' => 'object', 'type' => 'object',
'context' => array( 'view', 'edit', 'embed' ), 'context' => array( 'view', 'edit', 'embed' ),
'arg_options' => array( 'arg_options' => array(
@ -1439,12 +1439,12 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
), ),
'properties' => array( 'properties' => array(
'raw' => array( 'raw' => array(
'description' => __( 'Content for the object, as it exists in the database.' ), 'description' => __( 'Content for the comment, as it exists in the database.' ),
'type' => 'string', 'type' => 'string',
'context' => array( 'edit' ), 'context' => array( 'edit' ),
), ),
'rendered' => array( 'rendered' => array(
'description' => __( 'HTML content for the object, transformed for display.' ), 'description' => __( 'HTML content for the comment, transformed for display.' ),
'type' => 'string', 'type' => 'string',
'context' => array( 'view', 'edit', 'embed' ), 'context' => array( 'view', 'edit', 'embed' ),
'readonly' => true, 'readonly' => true,
@ -1452,26 +1452,26 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
), ),
), ),
'date' => array( 'date' => array(
'description' => __( "The date the object was published, in the site's timezone." ), 'description' => __( "The date the comment was published, in the site's timezone." ),
'type' => 'string', 'type' => 'string',
'format' => 'date-time', 'format' => 'date-time',
'context' => array( 'view', 'edit', 'embed' ), 'context' => array( 'view', 'edit', 'embed' ),
), ),
'date_gmt' => array( 'date_gmt' => array(
'description' => __( 'The date the object was published, as GMT.' ), 'description' => __( 'The date the comment was published, as GMT.' ),
'type' => 'string', 'type' => 'string',
'format' => 'date-time', 'format' => 'date-time',
'context' => array( 'view', 'edit' ), 'context' => array( 'view', 'edit' ),
), ),
'link' => array( 'link' => array(
'description' => __( 'URL to the object.' ), 'description' => __( 'URL to the comment.' ),
'type' => 'string', 'type' => 'string',
'format' => 'uri', 'format' => 'uri',
'context' => array( 'view', 'edit', 'embed' ), 'context' => array( 'view', 'edit', 'embed' ),
'readonly' => true, 'readonly' => true,
), ),
'parent' => array( 'parent' => array(
'description' => __( 'The ID for the parent of the object.' ), 'description' => __( 'The ID for the parent of the comment.' ),
'type' => 'integer', 'type' => 'integer',
'context' => array( 'view', 'edit', 'embed' ), 'context' => array( 'view', 'edit', 'embed' ),
'default' => 0, 'default' => 0,
@ -1483,7 +1483,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
'default' => 0, 'default' => 0,
), ),
'status' => array( 'status' => array(
'description' => __( 'State of the object.' ), 'description' => __( 'State of the comment.' ),
'type' => 'string', 'type' => 'string',
'context' => array( 'view', 'edit' ), 'context' => array( 'view', 'edit' ),
'arg_options' => array( 'arg_options' => array(
@ -1491,7 +1491,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
), ),
), ),
'type' => array( 'type' => array(
'description' => __( 'Type of Comment for the object.' ), 'description' => __( 'Type of the comment.' ),
'type' => 'string', 'type' => 'string',
'context' => array( 'view', 'edit', 'embed' ), 'context' => array( 'view', 'edit', 'embed' ),
'readonly' => true, 'readonly' => true,
@ -1515,7 +1515,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
} }
$schema['properties']['author_avatar_urls'] = array( $schema['properties']['author_avatar_urls'] = array(
'description' => __( 'Avatar URLs for the object author.' ), 'description' => __( 'Avatar URLs for the comment author.' ),
'type' => 'object', 'type' => 'object',
'context' => array( 'view', 'edit', 'embed' ), 'context' => array( 'view', 'edit', 'embed' ),
'readonly' => true, 'readonly' => true,
@ -1611,7 +1611,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
); );
$query_params['orderby'] = array( $query_params['orderby'] = array(
'description' => __( 'Sort collection by object attribute.' ), 'description' => __( 'Sort collection by comment attribute.' ),
'type' => 'string', 'type' => 'string',
'default' => 'date_gmt', 'default' => 'date_gmt',
'enum' => array( 'enum' => array(

View File

@ -27,7 +27,7 @@ class WP_REST_Post_Statuses_Controller extends WP_REST_Controller {
} }
/** /**
* Registers the routes for the objects of the controller. * Registers the routes for post statuses.
* *
* @since 4.7.0 * @since 4.7.0
* *

View File

@ -27,7 +27,7 @@ class WP_REST_Post_Types_Controller extends WP_REST_Controller {
} }
/** /**
* Registers the routes for the objects of the controller. * Registers the routes for post types.
* *
* @since 4.7.0 * @since 4.7.0
* *

View File

@ -56,7 +56,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
} }
/** /**
* Registers the routes for the objects of the controller. * Registers the routes for posts.
* *
* @since 4.7.0 * @since 4.7.0
* *
@ -100,7 +100,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
array( array(
'args' => array( 'args' => array(
'id' => array( 'id' => array(
'description' => __( 'Unique identifier for the object.' ), 'description' => __( 'Unique identifier for the post.' ),
'type' => 'integer', 'type' => 'integer',
), ),
), ),
@ -2153,31 +2153,31 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
// Base properties for every Post. // Base properties for every Post.
'properties' => array( 'properties' => array(
'date' => array( 'date' => array(
'description' => __( "The date the object was published, in the site's timezone." ), 'description' => __( "The date the post was published, in the site's timezone." ),
'type' => array( 'string', 'null' ), 'type' => array( 'string', 'null' ),
'format' => 'date-time', 'format' => 'date-time',
'context' => array( 'view', 'edit', 'embed' ), 'context' => array( 'view', 'edit', 'embed' ),
), ),
'date_gmt' => array( 'date_gmt' => array(
'description' => __( 'The date the object was published, as GMT.' ), 'description' => __( 'The date the post was published, as GMT.' ),
'type' => array( 'string', 'null' ), 'type' => array( 'string', 'null' ),
'format' => 'date-time', 'format' => 'date-time',
'context' => array( 'view', 'edit' ), 'context' => array( 'view', 'edit' ),
), ),
'guid' => array( 'guid' => array(
'description' => __( 'The globally unique identifier for the object.' ), 'description' => __( 'The globally unique identifier for the post.' ),
'type' => 'object', 'type' => 'object',
'context' => array( 'view', 'edit' ), 'context' => array( 'view', 'edit' ),
'readonly' => true, 'readonly' => true,
'properties' => array( 'properties' => array(
'raw' => array( 'raw' => array(
'description' => __( 'GUID for the object, as it exists in the database.' ), 'description' => __( 'GUID for the post, as it exists in the database.' ),
'type' => 'string', 'type' => 'string',
'context' => array( 'edit' ), 'context' => array( 'edit' ),
'readonly' => true, 'readonly' => true,
), ),
'rendered' => array( 'rendered' => array(
'description' => __( 'GUID for the object, transformed for display.' ), 'description' => __( 'GUID for the post, transformed for display.' ),
'type' => 'string', 'type' => 'string',
'context' => array( 'view', 'edit' ), 'context' => array( 'view', 'edit' ),
'readonly' => true, 'readonly' => true,
@ -2185,34 +2185,34 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
), ),
), ),
'id' => array( 'id' => array(
'description' => __( 'Unique identifier for the object.' ), 'description' => __( 'Unique identifier for the post.' ),
'type' => 'integer', 'type' => 'integer',
'context' => array( 'view', 'edit', 'embed' ), 'context' => array( 'view', 'edit', 'embed' ),
'readonly' => true, 'readonly' => true,
), ),
'link' => array( 'link' => array(
'description' => __( 'URL to the object.' ), 'description' => __( 'URL to the post.' ),
'type' => 'string', 'type' => 'string',
'format' => 'uri', 'format' => 'uri',
'context' => array( 'view', 'edit', 'embed' ), 'context' => array( 'view', 'edit', 'embed' ),
'readonly' => true, 'readonly' => true,
), ),
'modified' => array( 'modified' => array(
'description' => __( "The date the object was last modified, in the site's timezone." ), 'description' => __( "The date the post was last modified, in the site's timezone." ),
'type' => 'string', 'type' => 'string',
'format' => 'date-time', 'format' => 'date-time',
'context' => array( 'view', 'edit' ), 'context' => array( 'view', 'edit' ),
'readonly' => true, 'readonly' => true,
), ),
'modified_gmt' => array( 'modified_gmt' => array(
'description' => __( 'The date the object was last modified, as GMT.' ), 'description' => __( 'The date the post was last modified, as GMT.' ),
'type' => 'string', 'type' => 'string',
'format' => 'date-time', 'format' => 'date-time',
'context' => array( 'view', 'edit' ), 'context' => array( 'view', 'edit' ),
'readonly' => true, 'readonly' => true,
), ),
'slug' => array( 'slug' => array(
'description' => __( 'An alphanumeric identifier for the object unique to its type.' ), 'description' => __( 'An alphanumeric identifier for the post unique to its type.' ),
'type' => 'string', 'type' => 'string',
'context' => array( 'view', 'edit', 'embed' ), 'context' => array( 'view', 'edit', 'embed' ),
'arg_options' => array( 'arg_options' => array(
@ -2220,7 +2220,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
), ),
), ),
'status' => array( 'status' => array(
'description' => __( 'A named status for the object.' ), 'description' => __( 'A named status for the post.' ),
'type' => 'string', 'type' => 'string',
'enum' => array_keys( get_post_stati( array( 'internal' => false ) ) ), 'enum' => array_keys( get_post_stati( array( 'internal' => false ) ) ),
'context' => array( 'view', 'edit' ), 'context' => array( 'view', 'edit' ),
@ -2229,7 +2229,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
), ),
), ),
'type' => array( 'type' => array(
'description' => __( 'Type of Post for the object.' ), 'description' => __( 'Type of post.' ),
'type' => 'string', 'type' => 'string',
'context' => array( 'view', 'edit', 'embed' ), 'context' => array( 'view', 'edit', 'embed' ),
'readonly' => true, 'readonly' => true,
@ -2245,14 +2245,14 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
$post_type_obj = get_post_type_object( $this->post_type ); $post_type_obj = get_post_type_object( $this->post_type );
if ( is_post_type_viewable( $post_type_obj ) && $post_type_obj->public ) { if ( is_post_type_viewable( $post_type_obj ) && $post_type_obj->public ) {
$schema['properties']['permalink_template'] = array( $schema['properties']['permalink_template'] = array(
'description' => __( 'Permalink template for the object.' ), 'description' => __( 'Permalink template for the post.' ),
'type' => 'string', 'type' => 'string',
'context' => array( 'edit' ), 'context' => array( 'edit' ),
'readonly' => true, 'readonly' => true,
); );
$schema['properties']['generated_slug'] = array( $schema['properties']['generated_slug'] = array(
'description' => __( 'Slug automatically generated from the object title.' ), 'description' => __( 'Slug automatically generated from the post title.' ),
'type' => 'string', 'type' => 'string',
'context' => array( 'edit' ), 'context' => array( 'edit' ),
'readonly' => true, 'readonly' => true,
@ -2261,7 +2261,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
if ( $post_type_obj->hierarchical ) { if ( $post_type_obj->hierarchical ) {
$schema['properties']['parent'] = array( $schema['properties']['parent'] = array(
'description' => __( 'The ID for the parent of the object.' ), 'description' => __( 'The ID for the parent of the post.' ),
'type' => 'integer', 'type' => 'integer',
'context' => array( 'view', 'edit' ), 'context' => array( 'view', 'edit' ),
); );
@ -2322,7 +2322,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
case 'title': case 'title':
$schema['properties']['title'] = array( $schema['properties']['title'] = array(
'description' => __( 'The title for the object.' ), 'description' => __( 'The title for the post.' ),
'type' => 'object', 'type' => 'object',
'context' => array( 'view', 'edit', 'embed' ), 'context' => array( 'view', 'edit', 'embed' ),
'arg_options' => array( 'arg_options' => array(
@ -2331,12 +2331,12 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
), ),
'properties' => array( 'properties' => array(
'raw' => array( 'raw' => array(
'description' => __( 'Title for the object, as it exists in the database.' ), 'description' => __( 'Title for the post, as it exists in the database.' ),
'type' => 'string', 'type' => 'string',
'context' => array( 'edit' ), 'context' => array( 'edit' ),
), ),
'rendered' => array( 'rendered' => array(
'description' => __( 'HTML title for the object, transformed for display.' ), 'description' => __( 'HTML title for the post, transformed for display.' ),
'type' => 'string', 'type' => 'string',
'context' => array( 'view', 'edit', 'embed' ), 'context' => array( 'view', 'edit', 'embed' ),
'readonly' => true, 'readonly' => true,
@ -2347,7 +2347,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
case 'editor': case 'editor':
$schema['properties']['content'] = array( $schema['properties']['content'] = array(
'description' => __( 'The content for the object.' ), 'description' => __( 'The content for the post.' ),
'type' => 'object', 'type' => 'object',
'context' => array( 'view', 'edit' ), 'context' => array( 'view', 'edit' ),
'arg_options' => array( 'arg_options' => array(
@ -2356,18 +2356,18 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
), ),
'properties' => array( 'properties' => array(
'raw' => array( 'raw' => array(
'description' => __( 'Content for the object, as it exists in the database.' ), 'description' => __( 'Content for the post, as it exists in the database.' ),
'type' => 'string', 'type' => 'string',
'context' => array( 'edit' ), 'context' => array( 'edit' ),
), ),
'rendered' => array( 'rendered' => array(
'description' => __( 'HTML content for the object, transformed for display.' ), 'description' => __( 'HTML content for the post, transformed for display.' ),
'type' => 'string', 'type' => 'string',
'context' => array( 'view', 'edit' ), 'context' => array( 'view', 'edit' ),
'readonly' => true, 'readonly' => true,
), ),
'block_version' => array( 'block_version' => array(
'description' => __( 'Version of the content block format used by the object.' ), 'description' => __( 'Version of the content block format used by the post.' ),
'type' => 'integer', 'type' => 'integer',
'context' => array( 'edit' ), 'context' => array( 'edit' ),
'readonly' => true, 'readonly' => true,
@ -2384,7 +2384,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
case 'author': case 'author':
$schema['properties']['author'] = array( $schema['properties']['author'] = array(
'description' => __( 'The ID for the author of the object.' ), 'description' => __( 'The ID for the author of the post.' ),
'type' => 'integer', 'type' => 'integer',
'context' => array( 'view', 'edit', 'embed' ), 'context' => array( 'view', 'edit', 'embed' ),
); );
@ -2392,7 +2392,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
case 'excerpt': case 'excerpt':
$schema['properties']['excerpt'] = array( $schema['properties']['excerpt'] = array(
'description' => __( 'The excerpt for the object.' ), 'description' => __( 'The excerpt for the post.' ),
'type' => 'object', 'type' => 'object',
'context' => array( 'view', 'edit', 'embed' ), 'context' => array( 'view', 'edit', 'embed' ),
'arg_options' => array( 'arg_options' => array(
@ -2401,12 +2401,12 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
), ),
'properties' => array( 'properties' => array(
'raw' => array( 'raw' => array(
'description' => __( 'Excerpt for the object, as it exists in the database.' ), 'description' => __( 'Excerpt for the post, as it exists in the database.' ),
'type' => 'string', 'type' => 'string',
'context' => array( 'edit' ), 'context' => array( 'edit' ),
), ),
'rendered' => array( 'rendered' => array(
'description' => __( 'HTML excerpt for the object, transformed for display.' ), 'description' => __( 'HTML excerpt for the post, transformed for display.' ),
'type' => 'string', 'type' => 'string',
'context' => array( 'view', 'edit', 'embed' ), 'context' => array( 'view', 'edit', 'embed' ),
'readonly' => true, 'readonly' => true,
@ -2423,7 +2423,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
case 'thumbnail': case 'thumbnail':
$schema['properties']['featured_media'] = array( $schema['properties']['featured_media'] = array(
'description' => __( 'The ID of the featured media for the object.' ), 'description' => __( 'The ID of the featured media for the post.' ),
'type' => 'integer', 'type' => 'integer',
'context' => array( 'view', 'edit', 'embed' ), 'context' => array( 'view', 'edit', 'embed' ),
); );
@ -2431,13 +2431,13 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
case 'comments': case 'comments':
$schema['properties']['comment_status'] = array( $schema['properties']['comment_status'] = array(
'description' => __( 'Whether or not comments are open on the object.' ), 'description' => __( 'Whether or not comments are open on the post.' ),
'type' => 'string', 'type' => 'string',
'enum' => array( 'open', 'closed' ), 'enum' => array( 'open', 'closed' ),
'context' => array( 'view', 'edit' ), 'context' => array( 'view', 'edit' ),
); );
$schema['properties']['ping_status'] = array( $schema['properties']['ping_status'] = array(
'description' => __( 'Whether or not the object can be pinged.' ), 'description' => __( 'Whether or not the post can be pinged.' ),
'type' => 'string', 'type' => 'string',
'enum' => array( 'open', 'closed' ), 'enum' => array( 'open', 'closed' ),
'context' => array( 'view', 'edit' ), 'context' => array( 'view', 'edit' ),
@ -2446,7 +2446,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
case 'page-attributes': case 'page-attributes':
$schema['properties']['menu_order'] = array( $schema['properties']['menu_order'] = array(
'description' => __( 'The order of the object in relation to other object of its type.' ), 'description' => __( 'The order of the post in relation to other posts.' ),
'type' => 'integer', 'type' => 'integer',
'context' => array( 'view', 'edit' ), 'context' => array( 'view', 'edit' ),
); );
@ -2457,7 +2457,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
$formats = array_values( get_post_format_slugs() ); $formats = array_values( get_post_format_slugs() );
$schema['properties']['format'] = array( $schema['properties']['format'] = array(
'description' => __( 'The format for the object.' ), 'description' => __( 'The format for the post.' ),
'type' => 'string', 'type' => 'string',
'enum' => $formats, 'enum' => $formats,
'context' => array( 'view', 'edit' ), 'context' => array( 'view', 'edit' ),
@ -2473,14 +2473,14 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
if ( 'post' === $this->post_type ) { if ( 'post' === $this->post_type ) {
$schema['properties']['sticky'] = array( $schema['properties']['sticky'] = array(
'description' => __( 'Whether or not the object should be treated as sticky.' ), 'description' => __( 'Whether or not the post should be treated as sticky.' ),
'type' => 'boolean', 'type' => 'boolean',
'context' => array( 'view', 'edit' ), 'context' => array( 'view', 'edit' ),
); );
} }
$schema['properties']['template'] = array( $schema['properties']['template'] = array(
'description' => __( 'The theme file to use to display the object.' ), 'description' => __( 'The theme file to use to display the post.' ),
'type' => 'string', 'type' => 'string',
'context' => array( 'view', 'edit' ), 'context' => array( 'view', 'edit' ),
'arg_options' => array( 'arg_options' => array(
@ -2510,7 +2510,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
$schema['properties'][ $base ] = array( $schema['properties'][ $base ] = array(
/* translators: %s: Taxonomy name. */ /* translators: %s: Taxonomy name. */
'description' => sprintf( __( 'The terms assigned to the object in the %s taxonomy.' ), $taxonomy->name ), 'description' => sprintf( __( 'The terms assigned to the post in the %s taxonomy.' ), $taxonomy->name ),
'type' => 'array', 'type' => 'array',
'items' => array( 'items' => array(
'type' => 'integer', 'type' => 'integer',
@ -2780,7 +2780,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
); );
$query_params['orderby'] = array( $query_params['orderby'] = array(
'description' => __( 'Sort collection by object attribute.' ), 'description' => __( 'Sort collection by post attribute.' ),
'type' => 'string', 'type' => 'string',
'default' => 'date', 'default' => 'date',
'enum' => array( 'enum' => array(

View File

@ -75,7 +75,7 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
array( array(
'args' => array( 'args' => array(
'parent' => array( 'parent' => array(
'description' => __( 'The ID for the parent of the object.' ), 'description' => __( 'The ID for the parent of the revision.' ),
'type' => 'integer', 'type' => 'integer',
), ),
), ),
@ -95,11 +95,11 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
array( array(
'args' => array( 'args' => array(
'parent' => array( 'parent' => array(
'description' => __( 'The ID for the parent of the object.' ), 'description' => __( 'The ID for the parent of the revision.' ),
'type' => 'integer', 'type' => 'integer',
), ),
'id' => array( 'id' => array(
'description' => __( 'Unique identifier for the object.' ), 'description' => __( 'Unique identifier for the revision.' ),
'type' => 'integer', 'type' => 'integer',
), ),
), ),
@ -675,51 +675,51 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
// Base properties for every Revision. // Base properties for every Revision.
'properties' => array( 'properties' => array(
'author' => array( 'author' => array(
'description' => __( 'The ID for the author of the object.' ), 'description' => __( 'The ID for the author of the revision.' ),
'type' => 'integer', 'type' => 'integer',
'context' => array( 'view', 'edit', 'embed' ), 'context' => array( 'view', 'edit', 'embed' ),
), ),
'date' => array( 'date' => array(
'description' => __( "The date the object was published, in the site's timezone." ), 'description' => __( "The date the revision was published, in the site's timezone." ),
'type' => 'string', 'type' => 'string',
'format' => 'date-time', 'format' => 'date-time',
'context' => array( 'view', 'edit', 'embed' ), 'context' => array( 'view', 'edit', 'embed' ),
), ),
'date_gmt' => array( 'date_gmt' => array(
'description' => __( 'The date the object was published, as GMT.' ), 'description' => __( 'The date the revision was published, as GMT.' ),
'type' => 'string', 'type' => 'string',
'format' => 'date-time', 'format' => 'date-time',
'context' => array( 'view', 'edit' ), 'context' => array( 'view', 'edit' ),
), ),
'guid' => array( 'guid' => array(
'description' => __( 'GUID for the object, as it exists in the database.' ), 'description' => __( 'GUID for the revision, as it exists in the database.' ),
'type' => 'string', 'type' => 'string',
'context' => array( 'view', 'edit' ), 'context' => array( 'view', 'edit' ),
), ),
'id' => array( 'id' => array(
'description' => __( 'Unique identifier for the object.' ), 'description' => __( 'Unique identifier for the revision.' ),
'type' => 'integer', 'type' => 'integer',
'context' => array( 'view', 'edit', 'embed' ), 'context' => array( 'view', 'edit', 'embed' ),
), ),
'modified' => array( 'modified' => array(
'description' => __( "The date the object was last modified, in the site's timezone." ), 'description' => __( "The date the revision was last modified, in the site's timezone." ),
'type' => 'string', 'type' => 'string',
'format' => 'date-time', 'format' => 'date-time',
'context' => array( 'view', 'edit' ), 'context' => array( 'view', 'edit' ),
), ),
'modified_gmt' => array( 'modified_gmt' => array(
'description' => __( 'The date the object was last modified, as GMT.' ), 'description' => __( 'The date the revision was last modified, as GMT.' ),
'type' => 'string', 'type' => 'string',
'format' => 'date-time', 'format' => 'date-time',
'context' => array( 'view', 'edit' ), 'context' => array( 'view', 'edit' ),
), ),
'parent' => array( 'parent' => array(
'description' => __( 'The ID for the parent of the object.' ), 'description' => __( 'The ID for the parent of the revision.' ),
'type' => 'integer', 'type' => 'integer',
'context' => array( 'view', 'edit', 'embed' ), 'context' => array( 'view', 'edit', 'embed' ),
), ),
'slug' => array( 'slug' => array(
'description' => __( 'An alphanumeric identifier for the object unique to its type.' ), 'description' => __( 'An alphanumeric identifier for the revision unique to its type.' ),
'type' => 'string', 'type' => 'string',
'context' => array( 'view', 'edit', 'embed' ), 'context' => array( 'view', 'edit', 'embed' ),
), ),

View File

@ -82,7 +82,7 @@ class WP_REST_Search_Controller extends WP_REST_Controller {
} }
/** /**
* Registers the routes for the objects of the controller. * Registers the routes for the search controller.
* *
* @since 5.0.0 * @since 5.0.0
* *

View File

@ -27,7 +27,7 @@ class WP_REST_Settings_Controller extends WP_REST_Controller {
} }
/** /**
* Registers the routes for the objects of the controller. * Registers the routes for the site's settings.
* *
* @since 4.7.0 * @since 4.7.0
* *

View File

@ -27,7 +27,7 @@ class WP_REST_Taxonomies_Controller extends WP_REST_Controller {
} }
/** /**
* Registers the routes for the objects of the controller. * Registers the routes for taxonomies.
* *
* @since 4.7.0 * @since 4.7.0
* *

View File

@ -65,7 +65,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
} }
/** /**
* Registers the routes for the objects of the controller. * Registers the routes for terms.
* *
* @since 4.7.0 * @since 4.7.0
* *

View File

@ -27,7 +27,7 @@ class WP_REST_Themes_Controller extends WP_REST_Controller {
} }
/** /**
* Registers the routes for the objects of the controller. * Registers the routes for themes.
* *
* @since 5.0.0 * @since 5.0.0
* *

View File

@ -37,7 +37,7 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
} }
/** /**
* Registers the routes for the objects of the controller. * Registers the routes for users.
* *
* @since 4.7.0 * @since 4.7.0
* *
@ -1520,7 +1520,7 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
$query_params['orderby'] = array( $query_params['orderby'] = array(
'default' => 'name', 'default' => 'name',
'description' => __( 'Sort collection by object attribute.' ), 'description' => __( 'Sort collection by user attribute.' ),
'enum' => array( 'enum' => array(
'id', 'id',
'include', 'include',

View File

@ -17,7 +17,7 @@
class WP_REST_Comment_Meta_Fields extends WP_REST_Meta_Fields { class WP_REST_Comment_Meta_Fields extends WP_REST_Meta_Fields {
/** /**
* Retrieves the object type for comment meta. * Retrieves the comment type for comment meta.
* *
* @since 4.7.0 * @since 4.7.0
* *
@ -28,7 +28,7 @@ class WP_REST_Comment_Meta_Fields extends WP_REST_Meta_Fields {
} }
/** /**
* Retrieves the object meta subtype. * Retrieves the comment meta subtype.
* *
* @since 4.9.8 * @since 4.9.8
* *

View File

@ -36,7 +36,7 @@ class WP_REST_Post_Meta_Fields extends WP_REST_Meta_Fields {
} }
/** /**
* Retrieves the object meta type. * Retrieves the post meta type.
* *
* @since 4.7.0 * @since 4.7.0
* *
@ -47,7 +47,7 @@ class WP_REST_Post_Meta_Fields extends WP_REST_Meta_Fields {
} }
/** /**
* Retrieves the object meta subtype. * Retrieves the post meta subtype.
* *
* @since 4.9.8 * @since 4.9.8
* *

View File

@ -36,7 +36,7 @@ class WP_REST_Term_Meta_Fields extends WP_REST_Meta_Fields {
} }
/** /**
* Retrieves the object meta type. * Retrieves the term meta type.
* *
* @since 4.7.0 * @since 4.7.0
* *
@ -47,7 +47,7 @@ class WP_REST_Term_Meta_Fields extends WP_REST_Meta_Fields {
} }
/** /**
* Retrieves the object meta subtype. * Retrieves the term meta subtype.
* *
* @since 4.9.8 * @since 4.9.8
* *

View File

@ -17,7 +17,7 @@
class WP_REST_User_Meta_Fields extends WP_REST_Meta_Fields { class WP_REST_User_Meta_Fields extends WP_REST_Meta_Fields {
/** /**
* Retrieves the object meta type. * Retrieves the user meta type.
* *
* @since 4.7.0 * @since 4.7.0
* *
@ -28,7 +28,7 @@ class WP_REST_User_Meta_Fields extends WP_REST_Meta_Fields {
} }
/** /**
* Retrieves the object meta subtype. * Retrieves the user meta subtype.
* *
* @since 4.9.8 * @since 4.9.8
* *