Skip to content

Commit

Permalink
fix: always load default_configs
Browse files Browse the repository at this point in the history
  • Loading branch information
devuri committed Apr 13, 2024
1 parent fbab7a6 commit 3adbe84
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/inc/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,17 +245,20 @@ function wpInstalledPlugins(): array
function appConfig( ?string $file_path = null, ?string $filename = null ): array
{
$site_configs_dir = site_configs_dir();
$default_configs_dir = _configs_dir();

if ( ! $file_path && ! $filename ) {
// return default app array.
return require _configs_dir() . '/app.php';
return require $default_configs_dir . '/app.php';
}

$options_file = "{$file_path}/{$site_configs_dir}/{$filename}.php";

if ( file_exists( $options_file ) ) {
return require $options_file;
}
} elseif ( ! file_exists( $options_file ) ) {
return require $default_configs_dir . '/app.php';
}

return [];
}
Expand Down

0 comments on commit 3adbe84

Please sign in to comment.