WordPress at a glance
function is not described

WP_REST_Post_Statuses_Controller::get_items() public WP 4.7.0

Retrieves all post statuses, depending on user context.

{} It's a method of the class: WP_REST_Post_Statuses_Controller{}

No Hooks.

Return

WP_REST_Response/WP_Error. Response object on success, or WP_Error object on failure.

Usage

$WP_REST_Post_Statuses_Controller = new WP_REST_Post_Statuses_Controller();
$WP_REST_Post_Statuses_Controller->get_items( $request );
$request(WP_REST_Request) (required)
Full details about the request.

Changelog

Since 4.7.0 Introduced.

Code of WP_REST_Post_Statuses_Controller::get_items() WP 5.5.1

<?php
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 );
}