Automattic\WooCommerce\Blocks\BlockTypes

AbstractBlock::enqueue_scripts()protectedWC 1.0

Register/enqueue scripts used for this block on the frontend, during render.

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

Хуков нет.

Возвращает

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

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->enqueue_scripts( $attributes );
$attributes(массив)
Any attributes that currently are available from the block.
По умолчанию: []

Код AbstractBlock::enqueue_scripts() WC 8.7.0

protected function enqueue_scripts( array $attributes = [] ) {
	if ( null !== $this->get_block_type_script() ) {
		wp_enqueue_script( $this->get_block_type_script( 'handle' ) );
	}
}