| | |
| | | use JVBase\meta\Form; |
| | | use JVBase\meta\Meta; |
| | | use JVBase\registrar\Fields; |
| | | if (!defined('ABSPATH')) { |
| | | exit; |
| | | } |
| | | |
| | | /** |
| | | * Custom options for the site can be set here. They will need to be handled by the child plugin, but you can make use of the Meta.php this way |
| | |
| | | return $this->fields; |
| | | } |
| | | |
| | | public function getConfig(string $fieldName):array |
| | | { |
| | | $allFields = $this->fields->getFields(); |
| | | if (array_key_exists($fieldName, $allFields)) { |
| | | return $allFields[$fieldName]->getConfig(); |
| | | } |
| | | return []; |
| | | } |
| | | |
| | | public function resetOptions():void |
| | | { |
| | | if (empty($this->resetFields)) { |
| | |
| | | { |
| | | $meta = Meta::forOptions(); |
| | | $options['showFormID'] = false; |
| | | $options['classes'] = ['options']; |
| | | $result = Form::renderFormFrom( |
| | | $meta, |
| | | 'options', |