Automattic\WooCommerce\Blocks\BlockTypes
RelatedProducts::initialize
Initialize this block type.
- Hook into WP lifecycle.
- Register the block with WordPress.
- Hook into pre_render_block to update the query.
Метод класса: RelatedProducts{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->initialize();
Код RelatedProducts::initialize() RelatedProducts::initialize WC 10.4.2
protected function initialize() {
parent::initialize();
add_filter(
'pre_render_block',
array( $this, 'update_query' ),
10,
2
);
add_filter(
'render_block',
array( $this, 'render_block' ),
10,
2
);
}