Automattic\WooCommerce\Blocks\Assets

Api::get_asset_data()publicWC 1.0

Use package path to find an asset data file and return the data.

Method of the class: Api{}

No Hooks.

Return

Array. The asset data.

Usage

$Api = new Api();
$Api->get_asset_data( $filename );
$filename(string) (required)
The filename of the asset.

Api::get_asset_data() code WC 9.8.1

public function get_asset_data( $filename ) {
	$asset_path = $this->package->get_path( $filename );
	$asset      = file_exists( $asset_path ) ? require $asset_path : [];
	return $asset;
}