Automattic\WooCommerce\Blocks\Templates

SingleProductTemplateCompatibility::inject_hooks_after_the_wrapper()privateWC 1.0

Inject the hooks after the div wrapper.

Method of the class: SingleProductTemplateCompatibility{}

No Hooks.

Return

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() code WC 9.6.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
	);
}