wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema



_inject_theme_attribute_in_template_part_block › WordPress Function

Desde6.4.0
Obsoleton/a
_inject_theme_attribute_in_template_part_block ( $block )
Acesso:
  • private
Parâmetros:
  • (array) $block a parsed block.
    Required: Yes
Definido em:
Codex:

Injects the active theme's stylesheet as a `theme` attribute into a given template part block.



Fonte

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