Automattic\WooCommerce\Blocks\BlockTypes
AddToCartForm::enqueue_assets
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() AddToCartForm::enqueue assets WC 10.5.1
protected function enqueue_assets( $attributes, $content, $block ) {
$parsed_attributes = $this->parse_attributes( $attributes );
if ( 'stepper' !== $parsed_attributes['quantitySelectorStyle'] ) {
return;
}
parent::enqueue_assets( $attributes, $content, $block );
}