| File was renamed from base/options.php |
| | |
| | | |
| | | |
| | | class Options { |
| | | protected static Options $instance; |
| | | protected static options $instance; |
| | | protected array $resetFields = []; |
| | | protected string $resetInterval = 'daily'; |
| | | protected Fields $fields; |
| | |
| | | } |
| | | } |
| | | |
| | | public static function getInstance():Options { |
| | | public static function getInstance():options { |
| | | if (!isset(self::$instance)) { |
| | | self::$instance = new self(); |
| | | do_action('jvb_define_options'); |
| | |
| | | return $this->fields; |
| | | } |
| | | |
| | | public function getConfig(string $fieldName):array |
| | | public function getConfig(string $fieldName):?array |
| | | { |
| | | $allFields = $this->fields->getFields(); |
| | | if (array_key_exists($fieldName, $allFields)) { |
| | | return $allFields[$fieldName]->getConfig(); |
| | | } |
| | | return []; |
| | | return null; |
| | | } |
| | | |
| | | public function resetOptions():void |