|
if ( file_exists( $this->dist_path . 'js/' . $slug . '.asset.php' ) ) { |
|
$asset = require $this->dist_path . 'js/' . $slug . '.asset.php'; |
|
} elseif ( file_exists( $this->dist_path . 'css/' . $slug . '.asset.php' ) ) { |
|
$asset = require $this->dist_path . 'css/' . $slug . '.asset.php'; |
|
} elseif ( file_exists( $this->dist_path . 'blocks/' . $slug . '.asset.php' ) ) { |
|
$asset = require $this->dist_path . 'blocks/' . $slug . '.asset.php'; |
|
} else { |
|
$asset = [ |
|
'version' => $this->fallback_version, |
|
'dependencies' => [], |
|
]; |
|
} |
If a JS and CSS use the same handle, it might load incorrect asset PHP data.
because it always check js first.
maybe:
get_asset_info( $file_dir, $slug, $attribute = null )
Or include the dir in the slug:
get_asset_info( 'css/file' )
get_asset_info( 'js/file' )
This issue was originally reported by @turtlepod in https://github.com/10up/ui-kit-monorepo/issues/205
wp-framework/src/Assets/GetAssetInfo.php
Lines 64 to 75 in 4512e0b
If a JS and CSS use the same handle, it might load incorrect asset PHP data.
because it always check js first.
maybe:
Or include the dir in the slug:
This issue was originally reported by @turtlepod in https://github.com/10up/ui-kit-monorepo/issues/205