Automattic\WooCommerce\Blocks\Templates

SingleProductTemplateCompatibility::inject_hooks_after_the_wrapper()privateWC 1.0

Inject the hooks after the div wrapper.

Метод класса: SingleProductTemplateCompatibility{}

Хуков нет.

Возвращает

Массив.

Использование

// 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() WC 8.7.0

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
	);
}