W3cubDocs

/WordPress

unregister_block_template( string $template_name ): WP_Block_Template|WP_Error

Unregister a block template.

Parameters

$template_namestringrequired
Template name in the form of plugin_uri//template_name.

Return

WP_Block_Template|WP_Error The unregistered template object on success, WP_Error object on failure or if the template doesn’t exist.

Source

function unregister_block_template( $template_name ) {
	return WP_Block_Templates_Registry::get_instance()->unregister( $template_name );
}

Changelog

Version Description
6.7.0 Introduced.

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