/** * Inits Option tree */ public function initThemeOptions() { if (!class_exists('ctNHP_Options')) { self::getFilesLoader()->requireOnce(CT_THEME_LIB_DIR . '/createit/ctNHP_Options.class.php'); } //load our theme options $dir = CT_THEME_SETTINGS_MAIN_DIR . '/options'; //these variables are for being filled in theme $sections = array(); //section structure $tabs = array(); //additional, custom tabs $args = array(); //options configuration //include because we use injected variables. Otherwise we could use ctFilesLoader::includeOnce include self::getFilesLoader()->getFilePath($dir . '/init.php'); /** @var $order array */ foreach ($order as $e) { include self::getFilesLoader()->getFilePath($dir . '/_' . $e . '.php'); } //add options if ($s = apply_filters('ct_theme_loader.options.load', $sections)) { $sections = $s; } //lets initialize options global $NHP_Options; $NHP_Options = new ctNHP_Options($sections, $args, $tabs); if ($this->isUpgradeRequired()) { $NHP_Options->refresh(); } $theme_data = wp_get_theme(); //add current version update_option($this->projectName . '_theme_version', (double) $theme_data->get('Version')); add_action('nhp-opts-load-page-' . $NHP_Options->getOptionsPageName(), array($this, 'themeOptionsCustomAssets')); $this->callInitialized(); }