Automattic\WooCommerce\Blocks\BlockTypes
MiniCart::get_block_type_script
Get the frontend script handle for this block type.
Method of the class: MiniCart{}
No Hooks.
Returns
Array|String.
Usage
// protected - for code of main (parent) or child class $result = $this->get_block_type_script( $key );
- $key(string)
- Data to get, or default to everything.
Default:null
Notes
- See: $this->register_block_type()
MiniCart::get_block_type_script() MiniCart::get block type script code WC 10.9.4
protected function get_block_type_script( $key = null ) {
if ( is_cart() || is_checkout() || Features::is_enabled( 'experimental-iapi-mini-cart' ) ) {
return;
}
$script = array(
'handle' => 'wc-' . $this->block_name . '-block-frontend',
'path' => $this->asset_api->get_block_asset_build_path( $this->block_name . '-frontend' ),
'dependencies' => array(),
);
return $key ? $script[ $key ] : $script;
}