castopod/modules/Plugins/Helpers/plugins_helper.php
Yassine Doghri 27d2a1b0ff feat(plugins): activate / deactivate plugin using settings table
+ load plugin icon
+ add pagination
+ autoload plugins in Config/Autoload.php to handle plugin
i18n
+ style plugin cards
2024-06-14 15:53:32 +00:00

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);
}
}