From bd603317466660ed3312d543f1ea85cf0de78d46 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Thu, 22 May 2025 17:34:37 +0300 Subject: [PATCH 1/3] Hook prefix the new filter --- src/Assets/Config.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Assets/Config.php b/src/Assets/Config.php index 6279f90..d2a4361 100644 --- a/src/Assets/Config.php +++ b/src/Assets/Config.php @@ -85,6 +85,7 @@ public static function is_group_path_using_asset_directory_prefix( string $group * * @since 1.4.0 * @since 1.4.2 Added the ability to specify whether the group path is using the asset directory prefix. + * @since 1.4.10 Added the hook prefix to the filter. * * @throws RuntimeException If the root or relative path is not specified. * @@ -96,6 +97,8 @@ public static function is_group_path_using_asset_directory_prefix( string $group * @return void */ public static function add_group_path( string $group_path_slug, string $root, string $relative, bool $is_using_asset_directory_prefix = false ): void { + $hook_prefix = static::get_hook_prefix(); + /** * Allows for the group path to be filtered. * @@ -110,7 +113,7 @@ public static function add_group_path( string $group_path_slug, string $root, st * @param string $group_path_slug The slug of the group path. */ static::$group_paths[ $group_path_slug ] = apply_filters( - 'stellarwp/assets/group_path', + "stellarwp/assets/{$hook_prefix}/group_path", [ 'root' => self::normalize_path( $root ), 'relative' => trailingslashit( $relative ), From a01ad71aa7240bb595e8538069b44fa04bfbfafe Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Thu, 22 May 2025 17:35:31 +0300 Subject: [PATCH 2/3] version bump --- assets.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets.php b/assets.php index 38ac71f..6a9f281 100644 --- a/assets.php +++ b/assets.php @@ -2,7 +2,7 @@ /** * Plugin Name: Assets * Description: Asset library with a plugin bootstrap file for automated testing. - * Version: 1.4.9 + * Version: 1.4.10 * Author: StellarWP * Author URI: https://stellarwp.com */ From 1f0beaa279d0027919c8db9264561024f6948c63 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Thu, 22 May 2025 17:37:42 +0300 Subject: [PATCH 3/3] fixing broken test --- tests/wpunit/ConfigTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/wpunit/ConfigTest.php b/tests/wpunit/ConfigTest.php index f56493c..7153055 100644 --- a/tests/wpunit/ConfigTest.php +++ b/tests/wpunit/ConfigTest.php @@ -107,6 +107,7 @@ public function should_reset() { * @test */ public function should_add_group_paths() { + Config::set_hook_prefix( 'bork' ); Config::add_group_path( 'my-group-path-1', dirname( __DIR__, 2) . '/src/feature-1', 'app-1', true ); Config::add_group_path( 'my-group-path-2', dirname( __DIR__, 2) . '/src/feature-2', 'app-2', false );