Skip to content

Commit a7c196c

Browse files
authored
Merge pull request #43 from stellarwp/fix/hook-prefix-the-new-filter
Hook prefix the new filter
2 parents 0e66779 + 1f0beaa commit a7c196c

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

assets.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Plugin Name: Assets
44
* Description: Asset library with a plugin bootstrap file for automated testing.
5-
* Version: 1.4.9
5+
* Version: 1.4.10
66
* Author: StellarWP
77
* Author URI: https://stellarwp.com
88
*/

src/Assets/Config.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public static function is_group_path_using_asset_directory_prefix( string $group
8585
*
8686
* @since 1.4.0
8787
* @since 1.4.2 Added the ability to specify whether the group path is using the asset directory prefix.
88+
* @since 1.4.10 Added the hook prefix to the filter.
8889
*
8990
* @throws RuntimeException If the root or relative path is not specified.
9091
*
@@ -96,6 +97,8 @@ public static function is_group_path_using_asset_directory_prefix( string $group
9697
* @return void
9798
*/
9899
public static function add_group_path( string $group_path_slug, string $root, string $relative, bool $is_using_asset_directory_prefix = false ): void {
100+
$hook_prefix = static::get_hook_prefix();
101+
99102
/**
100103
* Allows for the group path to be filtered.
101104
*
@@ -110,7 +113,7 @@ public static function add_group_path( string $group_path_slug, string $root, st
110113
* @param string $group_path_slug The slug of the group path.
111114
*/
112115
static::$group_paths[ $group_path_slug ] = apply_filters(
113-
'stellarwp/assets/group_path',
116+
"stellarwp/assets/{$hook_prefix}/group_path",
114117
[
115118
'root' => self::normalize_path( $root ),
116119
'relative' => trailingslashit( $relative ),

tests/wpunit/ConfigTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ public function should_reset() {
107107
* @test
108108
*/
109109
public function should_add_group_paths() {
110+
Config::set_hook_prefix( 'bork' );
110111
Config::add_group_path( 'my-group-path-1', dirname( __DIR__, 2) . '/src/feature-1', 'app-1', true );
111112
Config::add_group_path( 'my-group-path-2', dirname( __DIR__, 2) . '/src/feature-2', 'app-2', false );
112113

0 commit comments

Comments
 (0)