_remove_theme_attribute_from_template_part_block()WP 6.4.0

Removes the theme attribute from a given template part block.

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

_remove_theme_attribute_from_template_part_block( $block );
$block(array) (required) (passed by reference — &)
a parsed block.

Changelog

Since 6.4.0 Introduced.

_remove_theme_attribute_from_template_part_block() code WP 6.8

function _remove_theme_attribute_from_template_part_block( &$block ) {
	if (
		'core/template-part' === $block['blockName'] &&
		isset( $block['attrs']['theme'] )
	) {
		unset( $block['attrs']['theme'] );
	}
}