WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/19/2017 04:35:28 AM (4 years ago)
Author:
rachelbaker
Message:

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.

Location:
branches/4.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

  • branches/4.7/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php

    r39957 r40081  
    17591759                    'type'        => 'string',
    17601760                    'enum'        => array_keys( get_post_stati( array( 'internal' => false ) ) ),
    1761                     'context'     => array( 'edit' ),
     1761                    'context'     => array( 'view', 'edit' ),
    17621762                ),
    17631763                'type'            => array(
Note: See TracChangeset for help on using the changeset viewer.