mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
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: https://github.com/WP-API/WP-API/commit/69f617d749e4f165b9e31c1c042eec45ade3e41f without any explanation in the commit message. Props dhanendran, jnylen0, rachelbaker. Fixes #39466. git-svn-id: https://develop.svn.wordpress.org/trunk@40080 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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.' ),
|
||||
|
||||
Reference in New Issue
Block a user