implement settings-page
This commit is contained in:
+18
-1
@@ -15,4 +15,21 @@ if (!function_exists('dd')) {
|
||||
array_map(function($arg) {var_dump($arg);}, func_get_args());
|
||||
die;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
define("DA_CASHED_CONFIG", [
|
||||
'da' => require plugin_dir_path(__FILE__) . 'configs/da.php',
|
||||
]);
|
||||
|
||||
|
||||
if (!function_exists('config')) {
|
||||
function config(string $key, ?string $default = null): null|string|array
|
||||
{
|
||||
$value = DA_CASHED_CONFIG;
|
||||
foreach (explode('.', $key) as $key) {
|
||||
$value = $value[$key] ?? $default;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user