Automattic\WooCommerce\Blocks\BlockTypes

RelatedProducts::initialize()protectedWC 1.0

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

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

}