Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

wp_enable_block_templates() WordPress Function

The wp_enable_block_templates() function enables the use of block templates on the specified post type. Block templates are a new feature in WordPress that allow you to specify a template for each block in your content. This makes it easy to create custom layouts for your content without having to edit your theme.

wp_enable_block_templates() #

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


Source

File: wp-includes/theme-templates.php

function wp_enable_block_templates() {
	if ( wp_is_block_theme() || WP_Theme_JSON_Resolver::theme_has_support() ) {
		add_theme_support( 'block-templates' );
	}
}


Top ↑

Changelog

Changelog
VersionDescription
5.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.