Automattic\WooCommerce\LayoutTemplates
LayoutTemplateRegistry::instantiate_layout_templates
Instantiate the matching layout templates and return them.
Метод класса: LayoutTemplateRegistry{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$LayoutTemplateRegistry = new LayoutTemplateRegistry(); $LayoutTemplateRegistry->instantiate_layout_templates( $query_params ): array;
- $query_params(массив)
- Query params.
По умолчанию:array()
Код LayoutTemplateRegistry::instantiate_layout_templates() LayoutTemplateRegistry::instantiate layout templates WC 10.8.1
public function instantiate_layout_templates( array $query_params = array() ): array {
// Make sure the block template logger is initialized before the templates are created,
// so that the logger will collect the template events.
$logger = BlockTemplateLogger::get_instance();
$layout_templates = array();
$layout_templates_info = $this->get_matching_layout_templates_info( $query_params );
foreach ( $layout_templates_info as $layout_template_info ) {
$layout_template = $this->get_layout_template_instance( $layout_template_info );
$layout_template_id = $layout_template->get_id();
$layout_templates[ $layout_template_id ] = $layout_template;
$logger->log_template_events_to_file( $layout_template_id );
}
return $layout_templates;
}