mirror of
https://code.castopod.org/adaures/castopod
synced 2025-06-05 08:52:00 +00:00
feat(plugins): add methods to easily retrieve general, podcast and episode settings in hooks methods
This commit is contained in:
parent
2035c39fd1
commit
3a900bbab6
@ -96,6 +96,21 @@ abstract class BasePlugin implements PluginInterface
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final public function getGeneralSetting(string $key): mixed
|
||||||
|
{
|
||||||
|
return get_plugin_option($this->key, $key);
|
||||||
|
}
|
||||||
|
|
||||||
|
final public function getPodcastSetting(int $podcastId, string $key): mixed
|
||||||
|
{
|
||||||
|
return get_plugin_option($this->key, $key, ['podcast', $podcastId]);
|
||||||
|
}
|
||||||
|
|
||||||
|
final public function getEpisodeSetting(int $episodeId, string $key): mixed
|
||||||
|
{
|
||||||
|
return get_plugin_option($this->key, $key, ['episode', $episodeId]);
|
||||||
|
}
|
||||||
|
|
||||||
final public function getStatus(): PluginStatus
|
final public function getStatus(): PluginStatus
|
||||||
{
|
{
|
||||||
return $this->status;
|
return $this->status;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user