W3cubDocs

/WordPress

WP_Block_Templates_Registry::is_registered( string $template_name ): bool

Checks if a template is registered.

Parameters

$template_namestringrequired
Template name.

Return

bool True if the template is registered, false otherwise.

Source

public function is_registered( $template_name ) {
	return isset( $this->registered_templates[ $template_name ] );
}

Changelog

Version Description
6.7.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_block_templates_registry/is_registered