Automattic\WooCommerce\EmailEditor\Engine\Templates
Templates::get_block_template
Get a block template by ID.
Метод класса: Templates{}
Хуков нет.
Возвращает
WP_Block_Template|null.
Использование
$Templates = new Templates(); $Templates->get_block_template( $template_slug );
- $template_slug(строка) (обязательный)
- The template slug.
Код Templates::get_block_template() Templates::get block template WC 11.2.1
public function get_block_template( $template_slug ) {
// Template id is always prefixed by active theme and get_stylesheet returns the active theme slug.
$template_id = get_stylesheet() . '//' . $template_slug;
return get_block_template( $template_id );
}