Automattic\WooCommerce\Blocks

BlockTemplatesController::get_block_templates_from_db()publicWC 1.0

Gets the templates saved in the database.

Метод класса: BlockTemplatesController{}

Хуков нет.

Возвращает

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

Использование

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

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 );
}