wp_enable_block_templates()WP 5.8.0

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

Internal function — this function is designed to be used by the kernel itself. It is not recommended to use this function in your code.

No Hooks.

Return

null. Nothing (null).

Usage

wp_enable_block_templates();

Changelog

Since 5.8.0 Introduced.

wp_enable_block_templates() code WP 6.4.3

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