Automattic\WooCommerce\Blocks
BlockTemplatesController::get_block_templates()
Get and build the block template objects from the block template files.
Method of the class: BlockTemplatesController{}
No Hooks.
Return
Array
. WP_Block_Template[] An array of block template objects.
Usage
$BlockTemplatesController = new BlockTemplatesController(); $BlockTemplatesController->get_block_templates( $slugs, $template_type );
- $slugs(array)
- An array of slugs to retrieve templates for.
Default: array() - $template_type(string)
- wp_template or wp_template_part.
Default: 'wp_template'
BlockTemplatesController::get_block_templates() BlockTemplatesController::get block templates code WC 9.3.3
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 ); }