Automattic\WooCommerce\Blocks\BlockTypes
ProductButton::enqueue_assets
Enqueue frontend assets for this block, just in time for rendering.
Метод класса: ProductButton{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->enqueue_assets( $attributes, $content, $block );
- $attributes(массив) (обязательный)
- Any attributes that currently are available from the block.
- $content(строка) (обязательный)
- The block content.
- $block(WP_Block) (обязательный)
- The block object.
Код ProductButton::enqueue_assets() ProductButton::enqueue assets WC 10.4.3
protected function enqueue_assets( array $attributes, $content, $block ) {
parent::enqueue_assets( $attributes, $content, $block );
wp_enqueue_script( 'wp-a11y' );
if ( wp_is_block_theme() ) {
add_action(
'wp_enqueue_scripts',
array( $this, 'dequeue_add_to_cart_scripts' )
);
}
}