Automattic\WooCommerce\Blocks\Utils
BlockTemplateUtils::get_block_template_area()
Returns area for template parts.
Метод класса: BlockTemplateUtils{}
Хуков нет.
Возвращает
Строку
. Template part area.
Использование
$result = BlockTemplateUtils::get_block_template_area( $template_slug, $template_type );
- $template_slug(строка) (обязательный)
- The template part slug (e.g. mini-cart).
- $template_type(строка) (обязательный)
- Either wp_template or wp_template_part.
Код BlockTemplateUtils::get_block_template_area() BlockTemplateUtils::get block template area WC 9.8.5
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'; }