Automattic\WooCommerce\Blocks\Templates
SingleProductTemplateCompatibility::inject_hooks_after_the_wrapper
Inject the hooks after the div wrapper.
Метод класса: SingleProductTemplateCompatibility{}
Хуков нет.
Возвращает
array.
Использование
// private - только в коде основоного (родительского) класса $result = $this->inject_hooks_after_the_wrapper( $block_content, $hooks );
- $block_content(строка) (обязательный)
- Block Content.
- $hooks(массив) (обязательный)
- Hooks to inject.
Код SingleProductTemplateCompatibility::inject_hooks_after_the_wrapper() SingleProductTemplateCompatibility::inject hooks after the wrapper WC 11.1.1
private function inject_hooks_after_the_wrapper( $block_content, $hooks ) {
$closing_tag_position = strpos( $block_content, '>' );
return substr_replace(
$block_content,
$this->get_hooks_buffer(
$hooks,
'before'
),
// Add 1 to the position to inject the content after the closing tag.
$closing_tag_position + 1,
0
);
}