wpseek.com
A WordPress-centric search engine for devs and theme authors



_remove_theme_attribute_from_template_part_block › WordPress Function

Since6.4.0
Deprecatedn/a
_remove_theme_attribute_from_template_part_block ( $block )
Access:
  • private
Parameters:
  • (array) $block a parsed block.
    Required: Yes
Defined at:
Codex:

Removes the `theme` attribute from a given template part block.



Source

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