- Timestamp:
- 12/13/2016 03:51:01 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
r39440 r39595 78 78 ) ); 79 79 80 $schema = $this->get_item_schema(); 81 $get_item_args = array( 82 'context' => $this->get_context_param( array( 'default' => 'view' ) ), 83 ); 84 if ( isset( $schema['properties']['password'] ) ) { 85 $get_item_args['password'] = array( 86 'description' => __( 'The password for the post if it is password protected.' ), 87 'type' => 'string', 88 ); 89 } 80 90 register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>[\d]+)', array( 81 91 array( … … 83 93 'callback' => array( $this, 'get_item' ), 84 94 'permission_callback' => array( $this, 'get_item_permissions_check' ), 85 'args' => array( 86 'context' => $this->get_context_param( array( 'default' => 'view' ) ), 87 'password' => array( 88 'description' => __( 'The password for the post if it is password protected.' ), 89 'type' => 'string', 90 ), 91 ), 95 'args' => $get_item_args, 92 96 ), 93 97 array(
Note: See TracChangeset
for help on using the changeset viewer.