Automattic\WooCommerce\Blocks\BlockTypes
ClassicTemplate::enqueue_data()
Extra data passed through from server to client for block.
Method of the class: ClassicTemplate{}
No Hooks.
Return
null
. Nothing (null).
Usage
// protected - for code of main (parent) or child class $result = $this->enqueue_data( $attributes );
- $attributes(array)
- Any attributes that currently are available from the block. Note, this will be empty in the editor context when the block is not in the post content on editor load.
Default: []
ClassicTemplate::enqueue_data() ClassicTemplate::enqueue data code WC 9.8.2
protected function enqueue_data( array $attributes = [] ) { parent::enqueue_data( $attributes ); // Indicate to interactivity powered components that this block is on the page, // and needs refresh to update data. $this->asset_data_registry->add( 'needsRefreshForInteractivityAPI', true ); }