Automattic\WooCommerce\Blocks\BlockTypes
Cart::enqueue_assets()
Enqueue frontend assets for this block, just in time for rendering.
Method of the class: Cart{}
Hooks from the method
Return
null
. Nothing (null).
Usage
// protected - for code of main (parent) or child class $result = $this->enqueue_assets( $attributes, $content, $block );
- $attributes(array) (required)
- Any attributes that currently are available from the block.
- $content(string) (required)
- The block content.
- $block(WP_Block) (required)
- The block object.
Cart::enqueue_assets() Cart::enqueue assets code WC 9.5.1
protected function enqueue_assets( array $attributes, $content, $block ) { /** * Fires before cart block scripts are enqueued. * * @since 2.6.0 */ do_action( 'woocommerce_blocks_enqueue_cart_block_scripts_before' ); parent::enqueue_assets( $attributes, $content, $block ); /** * Fires after cart block scripts are enqueued. * * @since 2.6.0 */ do_action( 'woocommerce_blocks_enqueue_cart_block_scripts_after' ); }