WordPress at a glance
function is not described

WP_REST_Block_Types_Controller::get_item() public WP 5.5.0

Retrieves a specific block type.

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

No Hooks.

Return

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

Usage

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

Changelog

Since 5.5.0 Introduced.

Code of WP_REST_Block_Types_Controller::get_item() WP 5.5.1

<?php
public function get_item( $request ) {
	$block_name = sprintf( '%s/%s', $request['namespace'], $request['name'] );
	$block_type = $this->get_block( $block_name );
	if ( is_wp_error( $block_type ) ) {
		return $block_type;
	}
	$data = $this->prepare_item_for_response( $block_type, $request );

	return rest_ensure_response( $data );
}