Automattic\WooCommerce\Blocks\BlockTypes

AbstractBlock::get_block_type_script()protectedWC 1.0

Get the frontend script handle for this block type.

Метод класса: AbstractBlock{}

Хуков нет.

Возвращает

Массив|Строку|null.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_block_type_script( $key );
$key(строка)
Data to get, or default to everything.
По умолчанию: null

Заметки

Код AbstractBlock::get_block_type_script() WC 8.7.0

protected function get_block_type_script( $key = null ) {
	$script = [
		'handle'       => 'wc-' . $this->block_name . '-block-frontend',
		'path'         => $this->asset_api->get_block_asset_build_path( $this->block_name . '-frontend' ),
		'dependencies' => [],
	];
	return $key ? $script[ $key ] : $script;
}