WordPress at a glance
function is not described

WP_REST_Themes_Controller::get_items() public WP 5.0.0

Retrieves a collection of themes.

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

No Hooks.

Return

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

Usage

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

Changelog

Since 5.0.0 Introduced.

Code of WP_REST_Themes_Controller::get_items() WP 5.5.1

<?php
public function get_items( $request ) {
	// Retrieve the list of registered collection query parameters.
	$registered = $this->get_collection_params();
	$themes     = array();

	if ( isset( $registered['status'], $request['status'] ) && in_array( 'active', $request['status'], true ) ) {
		$active_theme = wp_get_theme();
		$active_theme = $this->prepare_item_for_response( $active_theme, $request );
		$themes[]     = $this->prepare_response_for_collection( $active_theme );
	}

	$response = rest_ensure_response( $themes );

	$response->header( 'X-WP-Total', count( $themes ) );
	$response->header( 'X-WP-TotalPages', count( $themes ) );

	return $response;
}