Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
5 changes: 4 additions & 1 deletion src/Assets/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -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.
*
Expand All @@ -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 ),
Expand Down
1 change: 1 addition & 0 deletions tests/wpunit/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down
Loading