wordpress / latest / functions / block_template_part.html

block_template_part( string $part )

Prints a block template part.

Parameters

$part string Required
The block template part to print. Use "header" or "footer".

Source

File: wp-includes/block-template-utils.php. View all references

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

Uses

Uses Description

Used By

Used By Description

Changelog

Version Description
5.9.0 Introduced.

© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/block_template_part