REST API: Include the `status` property in `view` context responses from the Posts endpoints.

Previously the status for a Post (or other post_types) was only exposed under the `edit` context, which doesn't really make much sense considering we support querying by post status without authentication. Originally introduced in v2.0 beta 1: 69f617d749 without any explanation in the commit message.

Props dhanendran, jnylen0, rachelbaker.
Fixes #39466.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40017 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Rachel Baker 2017-02-19 04:32:41 +00:00
parent cf4e085207
commit da8ae2facd
2 changed files with 2 additions and 2 deletions

View File

@ -1767,7 +1767,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
'description' => __( 'A named status for the object.' ),
'type' => 'string',
'enum' => array_keys( get_post_stati( array( 'internal' => false ) ) ),
'context' => array( 'edit' ),
'context' => array( 'view', 'edit' ),
),
'type' => array(
'description' => __( 'Type of Post for the object.' ),

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.8-alpha-40077';
$wp_version = '4.8-alpha-40080';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.