WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/19/2017 04:31:12 AM (2 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.
Fixes #39466.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php

    r39967 r40080  
    17681768                    'type'        => 'string',
    17691769                    'enum'        => array_keys( get_post_stati( array( 'internal' => false ) ) ),
    1770                     'context'     => array( 'edit' ),
     1770                    'context'     => array( 'view', 'edit' ),
    17711771                ),
    17721772                'type'            => array(
Note: See TracChangeset for help on using the changeset viewer.