WP_Block_Templates_Registry::get_registered( string $template_name ): WP_Block_Template|null

In this article

Retrieves a registered template by its name.

Parameters

$template_namestringrequired
Template name including namespace.

Return

WP_Block_Template|null The registered template, or null if it is not registered.

Source

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

	return $this->registered_templates[ $template_name ];
}

Changelog

VersionDescription
6.7.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.