Automattic\WooCommerce\Blocks\BlockTypes
AbstractBlock::enqueue_scripts()
Register/enqueue scripts used for this block on the frontend, during render.
Method of the class: AbstractBlock{}
No Hooks.
Return
null
. Nothing (null).
Usage
// protected - for code of main (parent) or child class $result = $this->enqueue_scripts( $attributes );
- $attributes(array)
- Any attributes that currently are available from the block.
Default: []
AbstractBlock::enqueue_scripts() AbstractBlock::enqueue scripts code WC 8.6.1
protected function enqueue_scripts( array $attributes = [] ) { if ( null !== $this->get_block_type_script() ) { wp_enqueue_script( $this->get_block_type_script( 'handle' ) ); } }