Automattic\WooCommerce\Blocks
BlockTemplatesController::get_block_templates
Get and build the block template objects from the block template files.
Метод класса: BlockTemplatesController{}
Хуков нет.
Возвращает
Массив. WP_Block_Template[] An array of block template objects.
Использование
$BlockTemplatesController = new BlockTemplatesController(); $BlockTemplatesController->get_block_templates( $slugs, $template_type );
- $slugs(массив)
- An array of slugs to retrieve templates for.
По умолчанию:array() - $template_type(строка)
- wp_template or wp_template_part.
По умолчанию:'wp_template'
Код BlockTemplatesController::get_block_templates() BlockTemplatesController::get block templates WC 10.9.4
public function get_block_templates( $slugs = array(), $template_type = 'wp_template' ) {
$templates_from_db = BlockTemplateUtils::get_block_templates_from_db( $slugs, $template_type );
$templates_from_woo = $this->get_block_templates_from_woocommerce( $slugs, $templates_from_db, $template_type );
return array_merge( $templates_from_db, $templates_from_woo );
}