public function make($id, $options, $parent) { // Tack on the prefix. $this->section_id = $this->setting_prefix . $id; // Bring out the options. extract($options); // Is the parent set? if (!is_null($parent)) { // If subtab style is independent, then the section will just be grouped in the parent id. // If subtabs should be build off of sections, then the group will be the section id. $options['parent_id'] = $parent->options['subtab_style'] == 'independent' ? $parent->options['id'] : $id; // If there is no parent set then just put the sections in the general settings. } else { $options['parent_id'] = 'general'; } $this->section_options = $options; // Set up the callback class. $this->section_callback = new SectionCallbacks(); $this->section_callback->setProperties(array('id' => $this->section_id, 'title' => $this->section_options['title'], 'description' => $this->section_options['description'], 'group' => $this->section_options['parent_id'])); if ($parent) { $parent->registerChild('section', $id, $options); } // Create the Section with the Wordpress Settings Api. $this->addSection(); // add_action('admin_init', array($this, 'addSection')); // Register it later when all of it's children are registered. $this->registerSection(); // add_action('admin_init', array($this, 'registerSection'), 11); // Register the setting section with the setting registrar. SettingsRegistrar::getInstance()->registerSettingSection($this, $this->section_id, $this->section_options); // Create the children $this->makeChildren($contents, $this->section_callback); }
/** * Registers everythig from config and sets up actions for child theme extension; */ public function init() { $this->modules = ModulesRegistrar::getInstance(); $this->customizer = CustomizerRegistrar::getInstance(); $this->settings = SettingsRegistrar::getInstance(); // Register all the different content modules in the config file. $this->modules->register(); // Register all the different customizer settings from the config file. $this->customizer->register(); // Registers all of the different settings from the config file. $this->settings->register(); }