Commit 3a900bba authored by Yassine Doghri's avatar Yassine Doghri
Browse files

feat(plugins): add methods to easily retrieve general, podcast and episode...

feat(plugins): add methods to easily retrieve general, podcast and episode settings in hooks methods
parent 2035c39f
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -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
    {
        return $this->status;