Automattic\WooCommerce\Blocks\Templates
AbstractTemplateCompatibility::get_hooks_buffer
Get the buffer content of the hooks to append/prepend to render content.
Method of the class: AbstractTemplateCompatibility{}
Hooks from the method
Returns
String.
Usage
// protected - for code of main (parent) or child class $result = $this->get_hooks_buffer( $hooks, $position );
- $hooks(array) (required)
- The hooks to be rendered.
- $position(string) (required)
- The position of the hooks.
AbstractTemplateCompatibility::get_hooks_buffer() AbstractTemplateCompatibility::get hooks buffer code WC 10.6.2
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();
}