Automattic\WooCommerce\Blocks\BlockTypes

AbstractBlock::initialize()protectedWC 1.0

Initialize this block type.

  • Hook into WP lifecycle.
  • Register the block with WordPress.

Метод класса: AbstractBlock{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->initialize();

Код AbstractBlock::initialize() WC 8.7.0

protected function initialize() {
	if ( empty( $this->block_name ) ) {
		_doing_it_wrong( __METHOD__, esc_html__( 'Block name is required.', 'woocommerce' ), '4.5.0' );
		return false;
	}
	$this->integration_registry->initialize( $this->block_name . '_block' );
	$this->register_block_type_assets();
	$this->register_block_type();
	add_action( 'enqueue_block_editor_assets', [ $this, 'enqueue_editor_assets' ] );
}