REST API: Support password on non-post post types.

The password field was incorrectly only added to "post" post types, but is supported for all post types in the Dashboard UI.

Props jnylen0.
Fixes #38582.


git-svn-id: https://develop.svn.wordpress.org/trunk@39047 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan McCue
2016-10-31 03:52:08 +00:00
parent a86bc6f565
commit 4f9bc7535d
4 changed files with 81 additions and 8 deletions

View File

@@ -1747,6 +1747,11 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
'context' => array( 'view', 'edit', 'embed' ),
'readonly' => true,
),
'password' => array(
'description' => __( 'A password to protect access to the content and excerpt.' ),
'type' => 'string',
'context' => array( 'edit' ),
),
),
);
@@ -1948,12 +1953,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
'type' => 'boolean',
'context' => array( 'view', 'edit' ),
);
$schema['properties']['password'] = array(
'description' => __( 'A password to protect access to the content and excerpt.' ),
'type' => 'string',
'context' => array( 'edit' ),
);
}
if ( 'page' === $this->post_type ) {