block_template_part()WP 5.9.0

Prints a block template part.

Хуков нет.

Возвращает

null. Ничего (null).

Использование

block_template_part( $part );
$part(строка) (обязательный)
The block template part to print. Either 'header' or 'footer'.

Список изменений

С версии 5.9.0 Введена.

Код block_template_part() WP 6.5.2

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 );
}