W3cubDocs

/WordPress

wp_enable_block_templates()

Enables the block templates (editor mode) for themes with theme.json by default.

Source

function wp_enable_block_templates() {
	if ( wp_is_block_theme() || wp_theme_has_theme_json() ) {
		add_theme_support( 'block-templates' );
	}
}

Changelog

Version Description
5.8.0 Introduced.

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