Automattic\WooCommerce\Blocks\Assets

Api::get_asset_data()publicWC 1.0

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

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

Хуков нет.

Возвращает

Массив. The asset data.

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

$Api = new Api();
$Api->get_asset_data( $filename );
$filename(строка) (обязательный)
The filename of the asset.

Код Api::get_asset_data() WC 9.8.5

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