'5555555', 'blog_title' => 'Elegance Theme', 'location' => 'en_US', 'posts' => '4', 'comments' => '6', 'c_excerpt' => '50', 'tags' => '30' ); var $options; /******************************************************** END ********************************************************/ /******************************************************** Initiate new control panel function ********************************************************/ function ControlPanel() { add_action('admin_menu', array(&$this, 'add_menu')); add_action('admin_head', array(&$this, 'admin_head')); if (!is_array(get_option('elegance'))) add_option('elegance', $this->default_settings); $this->options = get_option('elegance'); } /******************************************************** END ********************************************************/ /******************************************************** Create a theme settings page to edit theme settings and put its css ********************************************************/ function add_menu() { add_theme_page('Theme Settings', 'Theme Settings', 'edit_themes', "elegance", array(&$this, 'optionsmenu')); } function admin_head() { print ''; } /******************************************************** END ********************************************************/ /******************************************************** The options page in control panel. Saving and editing goes here ********************************************************/ function optionsmenu() { if ($_POST['ss_action'] == 'save') { $this->options["feedburner_id"] = $_POST['cp_feedburnerid']; $this->options["blog_title"] = $_POST['cp_blogtitle']; $this->options["location"] = $_POST['cp_location']; $this->options["posts"] = $_POST['cp_posts']; $this->options["comments"] = $_POST['cp_comments']; $this->options["c_excerpt"] = $_POST['cp_c_excerpt']; $this->options["tags"] = $_POST['cp_tags']; update_option('elegance', $this->options); echo '
Elegance settings have been saved.