Automattic\WooCommerce\Blocks

BlockTemplatesController::get_block_templates_from_db()publicWC 1.0

Gets the templates saved in the database.

Method of the class: BlockTemplatesController{}

No Hooks.

Return

Int[]|\WP_Post[]. An array of found templates.

Usage

$BlockTemplatesController = new BlockTemplatesController();
$BlockTemplatesController->get_block_templates_from_db( $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_from_db() code WC 9.4.2

public function get_block_templates_from_db( $slugs = array(), $template_type = 'wp_template' ) {
	wc_deprecated_function( 'BlockTemplatesController::get_block_templates_from_db()', '7.8', '\Automattic\WooCommerce\Blocks\Utils\BlockTemplateUtils::get_block_templates_from_db()' );
	return BlockTemplateUtils::get_block_templates_from_db( $slugs, $template_type );
}