WP_Block_Type_Registry::get_registered()publicWP 5.0.0

Retrieves a registered block type.

Method of the class: WP_Block_Type_Registry{}

No Hooks.

Return

WP_Block_Type|null. The registered block type, or null if it is not registered.

Usage

$WP_Block_Type_Registry = new WP_Block_Type_Registry();
$WP_Block_Type_Registry->get_registered( $name );
$name(string) (required)
Block type name including namespace.

Changelog

Since 5.0.0 Introduced.

WP_Block_Type_Registry::get_registered() code WP 6.4.3

public function get_registered( $name ) {
	if ( ! $this->is_registered( $name ) ) {
		return null;
	}

	return $this->registered_block_types[ $name ];
}