Automattic\WooCommerce\Blocks\BlockTypes
AbstractBlock::enqueue_assets
Enqueue frontend assets for this block, just in time for rendering.
Method of the class: AbstractBlock{}
No Hooks.
Returns
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.
AbstractBlock::enqueue_assets() AbstractBlock::enqueue assets code WC 10.4.3
protected function enqueue_assets( array $attributes, $content, $block ) {
if ( $this->enqueued_assets ) {
return;
}
$this->enqueue_data( $attributes );
$this->enqueue_scripts( $attributes );
$this->enqueued_assets = true;
}