wpseek.com
WordPress开发者和主题制作者的搜索引擎



block_template_part › WordPress Function

Since5.9.0
已弃用n/a
block_template_part ( $part )
参数:
  • (string) $part The block template part to print. Either 'header' or 'footer'.
    Required: Yes
定义在:
文档:

Prints a block template part.



源码

function block_template_part( $part ) {
	$template_part = get_block_template( get_stylesheet() . '//' . $part, 'wp_template_part' );
	if ( ! $template_part || empty( $template_part->content ) ) {
		return;
	}
	echo do_blocks( $template_part->content );
}