mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +00:00
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:
@@ -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 ) {
|
||||
|
||||
Reference in New Issue
Block a user