Automattic\WooCommerce\Blocks\Templates
AbstractTemplateCompatibility::get_hooks_buffer
Get the buffer content of the hooks to append/prepend to render content.
Метод класса: AbstractTemplateCompatibility{}
Хуки из метода
Возвращает
Строку.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_hooks_buffer( $hooks, $position );
- $hooks(массив) (обязательный)
- The hooks to be rendered.
- $position(строка) (обязательный)
- The position of the hooks.
Код AbstractTemplateCompatibility::get_hooks_buffer() AbstractTemplateCompatibility::get hooks buffer WC 11.0.1
protected function get_hooks_buffer( $hooks, $position ) {
ob_start();
foreach ( $hooks as $hook => $data ) {
if ( $data['position'] === $position ) {
/**
* Action to render the content of a hook.
*
* @since 9.5.0
*/
do_action( $hook );
}
}
return ob_get_clean();
}