diff options
Diffstat (limited to 'src/ThemeUsesWordPressScripts.php')
-rw-r--r-- | src/ThemeUsesWordPressScripts.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/ThemeUsesWordPressScripts.php b/src/ThemeUsesWordPressScripts.php new file mode 100644 index 0000000..21cc501 --- /dev/null +++ b/src/ThemeUsesWordPressScripts.php @@ -0,0 +1,28 @@ +<?php + +namespace Dweipert\WpEnqueueAssets; + +trait ThemeUsesWordPressScripts +{ + use UsesWordPressScripts; + + /** + * @param string $asset + * + * @return string + */ + public function assetsUrl(string $asset): string + { + return get_stylesheet_directory_uri() . "/{$this->buildDir}/$asset"; + } + + /** + * @param string $asset + * + * @return array + */ + public function assetsMeta(string $asset): array + { + return include get_stylesheet_directory() . "/{$this->buildDir}/$asset.asset.php"; + } +} |