Automattic\WooCommerce\Blocks\BlockTypes

ClassicTemplate::enqueue_assetsprotectedWC 1.0

Enqueue assets specific to this block.

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

Хуков нет.

Возвращает

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

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->enqueue_assets( $attributes, $content, $block );
$attributes(массив) (обязательный)
Block attributes.
$content(строка) (обязательный)
Block content.
$block(WP_Block) (обязательный)
Block instance.

Код ClassicTemplate::enqueue_assets() WC 10.8.1

protected function enqueue_assets( $attributes, $content, $block ) {
	parent::enqueue_assets( $attributes, $content, $block );

	if ( is_product() ) {
		add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_legacy_assets' ], 20 );
	}
}