function evolve_init() { // Include the required files get_template_part('library/functions/options-interface'); get_template_part('library/functions/options-medialibrary-uploader'); // Loads the options array from the theme if ($optionsfile = locate_template(array('options.php'))) { get_template_part($optionsfile); } else { if (file_exists(dirname(__FILE__) . '/options.php')) { require_once dirname(__FILE__) . '/options.php'; } } $evolve_settings = get_option('evolve'); // Updates the unique option id in the database if it has changed evolve_option_name(); // Gets the unique id, returning a default if it isn't defined if (isset($evolve_settings['id'])) { $option_name = $evolve_settings['id']; } else { $option_name = 'evolve'; } // If the option has no saved data, load the defaults if (!get_option($option_name)) { evolve_setdefaults(); } // Registers the settings fields and callback if (!isset($_POST['evolve-backup-import'])) { register_setting('evolve', $option_name, 'evolve_validate'); } // Instantiate the media uploader class $evolve_media_uploader = new evolve_Framework_Media_Uploader(); $evolve_media_uploader->init(); }