Automattic\WooCommerce\Blocks\Templates
SingleProductTemplateCompatibility::inject_hooks_after_the_wrapper
Inject the hooks after the div wrapper.
Method of the class: SingleProductTemplateCompatibility{}
No Hooks.
Returns
Array.
Usage
// private - for code of main (parent) class only $result = $this->inject_hooks_after_the_wrapper( $block_content, $hooks );
- $block_content(string) (required)
- Block Content.
- $hooks(array) (required)
- Hooks to inject.
SingleProductTemplateCompatibility::inject_hooks_after_the_wrapper() SingleProductTemplateCompatibility::inject hooks after the wrapper code WC 10.6.2
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
);
}