LLMS_Assets::merge_asset_file( array $asset )
Retrieve dependency and version info from a script asset’s asset.php file
Description Description
Loads the asset.php file (generated via the @wordpress/dependency-extraction-webpack-plugin) and merges it into an existing asset array.
Parameters Parameters
- $asset
-
(array) (Required) An asset definition array.
Return Return
(array)
Source Source
File: includes/class-llms-assets.php
* @return array */ protected function merge_asset_file( $asset ) { if ( empty( $asset['asset_file'] ) ) { return $asset; } $asset_file_path = plugin_dir_path( $asset['base_file'] ) . trailingslashit( $asset['path'] ) . $asset['file_name'] . '.asset.php'; if ( file_exists( $asset_file_path ) ) { $info = include $asset_file_path; $asset['dependencies'] = array_merge( $asset['dependencies'], $info['dependencies'] ); $asset['version'] = $info['version']; } return $asset;
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
5.5.0 | Introduced. |