- Timestamp:
- 10/25/2016 05:12:18 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
r38832 r38911 1948 1948 public function validate_user_can_query_private_statuses( $value, $request, $parameter ) { 1949 1949 if ( 'publish' === $value ) { 1950 return true;1950 return rest_validate_request_arg( $value, $request, $parameter ); 1951 1951 } 1952 1952 $post_type_obj = get_post_type_object( $this->post_type ); 1953 1953 if ( current_user_can( $post_type_obj->cap->edit_posts ) ) { 1954 return true;1954 return rest_validate_request_arg( $value, $request, $parameter ); 1955 1955 } 1956 1956 return new WP_Error( 'rest_forbidden_status', __( 'Status is forbidden.' ), array( 'status' => rest_authorization_required_code() ) );
Note: See TracChangeset
for help on using the changeset viewer.