Automattic\WooCommerce\Blocks\Utils

BlockTemplateUtils::get_block_template_area()public staticWC 1.0

Returns area for template parts.

Method of the class: BlockTemplateUtils{}

No Hooks.

Return

String. Template part area.

Usage

$result = BlockTemplateUtils::get_block_template_area( $template_slug, $template_type );
$template_slug(string) (required)
The template part slug (e.g. mini-cart).
$template_type(string) (required)
Either wp_template or wp_template_part.

BlockTemplateUtils::get_block_template_area() code WC 9.0.1

public static function get_block_template_area( $template_slug, $template_type ) {
	if ( 'wp_template_part' === $template_type ) {
		$registered_template = self::get_template( $template_slug );
		if ( $registered_template && property_exists( $registered_template, 'template_area' ) ) {
			return $registered_template->template_area;
		}
	}
	return 'uncategorized';
}