_remove_theme_attribute_from_template_part_block

函数
_remove_theme_attribute_from_template_part_block ( $block )

删除给定模板部件区块中的 ` theme ` 属性。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function _remove_theme_attribute_from_template_part_block( &$block ) {
if (
'core/template-part' === $block['blockName'] &&
isset( $block['attrs']['theme'] )
) {
unset( $block['attrs']['theme'] );
}
}
function _remove_theme_attribute_from_template_part_block( &$block ) { if ( 'core/template-part' === $block['blockName'] && isset( $block['attrs']['theme'] ) ) { unset( $block['attrs']['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
查看更多 >