Automattic\WooCommerce\Blocks\BlockTypes
AbstractBlock::register_block_type_assets()
Register script and style assets for the block type before it is registered.
This registers the scripts; it does not enqueue them.
Method of the class: AbstractBlock{}
No Hooks.
Return
null
. Nothing (null).
Usage
// protected - for code of main (parent) or child class $result = $this->register_block_type_assets();
AbstractBlock::register_block_type_assets() AbstractBlock::register block type assets code WC 9.4.2
protected function register_block_type_assets() { if ( null !== $this->get_block_type_editor_script() ) { $data = $this->asset_api->get_script_data( $this->get_block_type_editor_script( 'path' ) ); $has_i18n = in_array( 'wp-i18n', $data['dependencies'], true ); $this->asset_api->register_script( $this->get_block_type_editor_script( 'handle' ), $this->get_block_type_editor_script( 'path' ), array_merge( $this->get_block_type_editor_script( 'dependencies' ), $this->integration_registry->get_all_registered_editor_script_handles() ), $has_i18n ); } if ( null !== $this->get_block_type_script() ) { $data = $this->asset_api->get_script_data( $this->get_block_type_script( 'path' ) ); $has_i18n = in_array( 'wp-i18n', $data['dependencies'], true ); $this->asset_api->register_script( $this->get_block_type_script( 'handle' ), $this->get_block_type_script( 'path' ), array_merge( $this->get_block_type_script( 'dependencies' ), $this->integration_registry->get_all_registered_script_handles() ), $has_i18n ); } }