diff --git src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
index 9d7f85a..36b0e48 100644
|
|
|
class WP_REST_Posts_Controller extends WP_REST_Controller { |
| 1906 | 1906 | 'default' => 'publish', |
| 1907 | 1907 | 'description' => __( 'Limit result set to posts assigned a specific status; can be comma-delimited list of status types.' ), |
| 1908 | 1908 | 'enum' => array_merge( array_keys( get_post_stati() ), array( 'any' ) ), |
| 1909 | | 'sanitize_callback' => 'sanitize_key', |
| 1910 | | 'type' => 'string', |
| | 1909 | 'sanitize_callback' => 'wp_parse_slug_list', |
| | 1910 | 'type' => 'array', |
| 1911 | 1911 | 'validate_callback' => array( $this, 'validate_user_can_query_private_statuses' ), |
| 1912 | 1912 | ); |
| 1913 | 1913 | $params['filter'] = array( |
| … |
… |
class WP_REST_Posts_Controller extends WP_REST_Controller { |
| 1946 | 1946 | * @return WP_Error|boolean |
| 1947 | 1947 | */ |
| 1948 | 1948 | public function validate_user_can_query_private_statuses( $value, $request, $parameter ) { |
| 1949 | | if ( 'publish' === $value ) { |
| | 1949 | if ( 'publish' === $value || is_array( $value ) && count( 1 === $value ) && in_array( 'publish', $value, true ) ) { |
| 1950 | 1950 | return true; |
| 1951 | 1951 | } |
| 1952 | 1952 | $post_type_obj = get_post_type_object( $this->post_type ); |