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 */ 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 ), 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 );