From 2dda813ae2d4e8a229395379f58936db5f313129 Mon Sep 17 00:00:00 2001 From: Rachel Baker Date: Sun, 19 Feb 2017 04:36:32 +0000 Subject: [PATCH] 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. Merges [40080] to the 4.7 branch. Fixes #39466. Built from https://develop.svn.wordpress.org/branches/4.7@40081 git-svn-id: http://core.svn.wordpress.org/branches/4.7@40018 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../rest-api/endpoints/class-wp-rest-posts-controller.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php index 7b27f60dec..1bf551f2af 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php @@ -1758,7 +1758,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.' ), diff --git a/wp-includes/version.php b/wp-includes/version.php index e1631c3b43..5ba35f1d74 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7.3-alpha-40079'; +$wp_version = '4.7.3-alpha-40081'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.