wp_enable_block_templates

The timeline below displays how wordpress function wp_enable_block_templates has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.2

/**
 * Enables the block templates (editor mode) for themes with theme.json by default.
 *
 * @access private
 * @since 5.8.0
 */
function wp_enable_block_templates()
{
    if (wp_is_block_theme() || wp_theme_has_theme_json()) {
        add_theme_support('block-templates');
    }
}

WordPress Version: 5.9

/**
 * Enables the block templates (editor mode) for themes with theme.json by default.
 *
 * @access private
 * @since 5.8.0
 */
function wp_enable_block_templates()
{
    if (wp_is_block_theme() || WP_Theme_JSON_Resolver::theme_has_support()) {
        add_theme_support('block-templates');
    }
}

WordPress Version: 5.8

/**
 * Enable the block templates (editor mode) for themes with theme.json by default.
 *
 * @access private
 * @since 5.8.0
 */
function wp_enable_block_templates()
{
    if (WP_Theme_JSON_Resolver::theme_has_support()) {
        add_theme_support('block-templates');
    }
}