Automattic\WooCommerce\Blocks\BlockTypes

AddToCartForm::enqueue_assets()protectedWC 1.0

Enqueue assets specific to this block. We enqueue frontend scripts only if the quantitySelectorStyle is set to 'stepper'.

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

Хуков нет.

Возвращает

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

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

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

Код AddToCartForm::enqueue_assets() WC 9.7.1

protected function enqueue_assets( $attributes, $content, $block ) {
	if ( 'stepper' !== $attributes['quantitySelectorStyle'] ) {
		return;
	}

	parent::enqueue_assets( $attributes, $content, $block );
}