Automattic\WooCommerce\Internal\Admin\BlockTemplates
BlockTemplateLogger::add_template_event
Add a template event.
Метод класса: BlockTemplateLogger{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// private - только в коде основоного (родительского) класса $result = $this->add_template_event( $event_type_info, $template, $container, $block, $additional_info );
- $event_type_info(массив) (обязательный)
- Event type info.
- $template(BlockTemplateInterface) (обязательный)
- Template.
- $container(ContainerInterface) (обязательный)
- Container.
- $block(BlockInterface) (обязательный)
- Block.
- $additional_info(массив)
- Additional info.
По умолчанию:array()
Код BlockTemplateLogger::add_template_event() BlockTemplateLogger::add template event WC 10.4.3
private function add_template_event( array $event_type_info, BlockTemplateInterface $template, ContainerInterface $container, BlockInterface $block, array $additional_info = array() ) {
$template_id = $template->get_id();
if ( ! isset( $this->all_template_events[ $template_id ] ) ) {
$this->all_template_events[ $template_id ] = array();
$this->templates[ $template_id ] = $template;
}
$template_events = &$this->all_template_events[ $template_id ];
$template_events[] = array(
'level' => $event_type_info['level'],
'event_type' => $event_type_info['event_type'],
'message' => $event_type_info['message'],
'container' => $container,
'block' => $block,
'additional_info' => $additional_info,
);
}