_remove_theme_attribute_from_template_part_block

函式
_remove_theme_attribute_from_template_part_block ( $block )

刪除給定模板部件區塊中的 ` theme ` 屬性。

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

常見問題

FAQs
檢視更多 >