Automattic\WooCommerce\Blocks
BlockTemplatesRegistry::get_template
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() 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;
}