mirror of
https://code.castopod.org/adaures/castopod
synced 2025-05-10 16:25:47 +00:00
25 lines
630 B
PHP
25 lines
630 B
PHP
![]() |
<?php
|
||
|
|
||
|
declare(strict_types=1);
|
||
|
|
||
|
if (! function_exists('get_plugin_option')) {
|
||
|
function get_plugin_option(string $pluginKey, string $option): mixed
|
||
|
{
|
||
|
$key = sprintf('Plugins.%s', $option);
|
||
|
$context = sprintf('plugin:%s', $pluginKey);
|
||
|
|
||
|
return setting()->get($key, $context);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (! function_exists('set_plugin_option')) {
|
||
|
function set_plugin_option(string $pluginKey, string $option, mixed $value = null): void
|
||
|
{
|
||
|
$key = sprintf('Plugins.%s', $option);
|
||
|
$context = sprintf('plugin:%s', $pluginKey);
|
||
|
|
||
|
setting()
|
||
|
->set($key, $value, $context);
|
||
|
}
|
||
|
}
|