Jake Vanderwerf
2026-08-25 3d25ad7de4fdbb3eba2cde2a62422e6be5d79a0a
base/options.php
@@ -4,6 +4,9 @@
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
@@ -87,6 +90,15 @@
      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)) {
@@ -138,6 +150,7 @@
   {
      $meta = Meta::forOptions();
      $options['showFormID'] = false;
      $options['classes'] = ['options'];
      $result = Form::renderFormFrom(
         $meta,
         'options',