public function get_items( $request ) {
		$data = array();
		$statuses = get_post_stati( array( 'internal' => false ), 'object' );
		$statuses['trash'] = get_post_status_object( 'trash' );
		foreach ( $statuses as $slug => $obj ) {
			$ret = $this->check_read_permission( $obj );
			if ( ! $ret ) {
				continue;
			}
			$status = $this->prepare_item_for_response( $obj, $request );
			$data[ $obj->name ] = $this->prepare_response_for_collection( $status );
		}
		return rest_ensure_response( $data );
	}
public function get_items( $request ) {
		$data = array();
		$statuses = get_post_stati( array( 'internal' => false ), 'object' );
		$statuses['trash'] = get_post_status_object( 'trash' );
		foreach ( $statuses as $slug => $obj ) {
			$ret = $this->check_read_permission( $obj );
			if ( ! $ret ) {
				continue;
			}
			$status = $this->prepare_item_for_response( $obj, $request );
			$data[ $obj->name ] = $this->prepare_response_for_collection( $status );
		}
		return rest_ensure_response( $data );
	}
public function get_items ( $ request ) { $ data = array ( ) ; $ statuses = get_post_stati ( array ( 'internal' => false ) , 'object' ) ; $ statuses [ 'trash' ] = get_post_status_object ( 'trash' ) ; foreach ( $ statuses as $ slug => $ obj ) { $ ret = $ this -> check_read_permission ( $ obj ) ; if ( ! $ ret ) { continue ; } $ status = $ this -> prepare_item_for_response ( $ obj , $ request ) ; $ data [ $ obj -> name ] = $ this -> prepare_response_for_collection ( $ status ) ; } return rest_ensure_response ( $ data ) ; }
Get all post statuses, depending on user context

@param WP_REST_Request $request
@return array|WP_Error
Get all post statuses depending on user context