Automattic\WooCommerce\Blocks\BlockTypes
SingleProduct::initialize()
Initialize the block and Hook into the render_block_context to update the context with the correct data.
Метод класса: SingleProduct{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->initialize();
Код SingleProduct::initialize() SingleProduct::initialize WC 9.5.1
protected function initialize() { parent::initialize(); add_filter( 'render_block_context', [ $this, 'update_context' ], 10, 3 ); add_filter( 'render_block_core/post-excerpt', [ $this, 'restore_global_post' ], 10, 3 ); add_filter( 'render_block_core/post-title', [ $this, 'restore_global_post' ], 10, 3 ); }