Automattic\WooCommerce\Blocks

BlockTemplatesRegistry::get_template │ public │ WC 1.0

Returns the template matching the slug

Метод класса: BlockTemplatesRegistry{}

Хуков нет.

Возвращает

AbstractTemplate|AbstractTemplatePart|null.

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

$BlockTemplatesRegistry = new BlockTemplatesRegistry();
$BlockTemplatesRegistry->get_template( $template_slug );
$template_slug(строка) (обязательный)
Slug of the template to retrieve.

Код BlockTemplatesRegistry::get_template() WC 11.2.2

public function get_template( $template_slug ) {
	if ( array_key_exists( $template_slug, $this->templates ) ) {
		$registered_template = $this->templates[ $template_slug ];
		return $registered_template;
	}
	return null;
}