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. Built from https://develop.svn.wordpress.org/trunk@39047 git-svn-id: http://core.svn.wordpress.org/trunk@38989 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6c1e98d1fb
commit
4dab905dba
|
@ -419,6 +419,8 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller {
|
|||
'readonly' => true,
|
||||
);
|
||||
|
||||
unset( $schema['properties']['password'] );
|
||||
|
||||
return $schema;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 ) {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.7-beta1-39046';
|
||||
$wp_version = '4.7-beta1-39047';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue