From 9a25f1f47e9df0b1c09f666741b49e370ccc6440 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Mon, 3 Jun 2024 13:34:07 +0200 Subject: fixes asset.php path for scripts version 28 --- src/UsesWordPressScripts.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/UsesWordPressScripts.php') diff --git a/src/UsesWordPressScripts.php b/src/UsesWordPressScripts.php index c565575..dd35602 100644 --- a/src/UsesWordPressScripts.php +++ b/src/UsesWordPressScripts.php @@ -17,7 +17,7 @@ trait UsesWordPressScripts */ public function enqueueScript(string $handle, string $asset, array $deps = [], bool $inFooter = false) { - $assetBaseName = pathinfo($asset, PATHINFO_FILENAME); + $assetBaseName = str_replace('.' . pathinfo($asset, PATHINFO_EXTENSION), '', $asset); $meta = $this->assetsMeta($assetBaseName); wp_enqueue_script( @@ -37,7 +37,7 @@ trait UsesWordPressScripts */ public function enqueueStyle(string $handle, string $asset, array $deps = [], string $media = 'all') { - $assetBaseName = pathinfo($asset, PATHINFO_FILENAME); + $assetBaseName = str_replace('.' . pathinfo($asset, PATHINFO_EXTENSION), '', $asset); $meta = $this->assetsMeta($assetBaseName); wp_enqueue_style( -- cgit v1.2.3