_inject_theme_attribute_in_template_part_block

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

WordPress Version: 6.4

/**
 * Injects the active theme's stylesheet as a `theme` attribute
 * into a given template part block.
 *
 * @since 6.4.0
 * @access private
 *
 * @param array $block a parsed block.
 */
function _inject_theme_attribute_in_template_part_block(&$block)
{
    if ('core/template-part' === $block['blockName'] && !isset($block['attrs']['theme'])) {
        $block['attrs']['theme'] = get_stylesheet();
    }
}