summaryrefslogtreecommitdiff
path: root/src/ThemeUsesWordPressScripts.php
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2021-10-09 19:46:58 +0200
committerDaniel Weipert <code@drogueronin.de>2021-10-09 19:46:58 +0200
commit3d94a6d9b74be03b58049dd24ff59145f24b36a1 (patch)
treea4b8b05f552db447ad84c17f8cd41bd63774ef04 /src/ThemeUsesWordPressScripts.php
parent52f7203992e1c8662d421e7287e1e1e5f1c2b7cd (diff)
Splits into two separate Traits for Themes and Pluginsv2.0.0
Diffstat (limited to 'src/ThemeUsesWordPressScripts.php')
-rw-r--r--src/ThemeUsesWordPressScripts.php28
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";
+ }
+}