function wt_save_options() { $options = get_option(THEME_SLUG . '_' . $this->name); if (isset($_POST['save_options'])) { foreach ($this->options as $get_options) { if (isset($get_options['id']) && !empty($get_options['id'])) { if (isset($_POST[$get_options['id']])) { if ($get_options['type'] == 'wt_multidropdown') { if (empty($_POST[$get_options['id']])) { $options[$get_options['id']] = array(); } else { $options[$get_options['id']] = array_unique(explode(',', $_POST[$get_options['id']])); } } elseif ($get_options['type'] == 'wt_toggle') { if ($_POST[$get_options['id']] == 'true') { $options[$get_options['id']] = true; } else { $options[$get_options['id']] = false; } } elseif ($get_options['type'] == 'wt_tritoggle') { if ($_POST[$get_options['id']] == 'true') { $options[$get_options['id']] = true; } elseif ($_POST[$get_options['id']] == 'false') { $options[$get_options['id']] = false; } else { $options[$get_options['id']] = 'default'; } } else { $options[$get_options['id']] = $_POST[$get_options['id']]; } } else { $options[$get_options['id']] = false; } } if (isset($get_options['process']) && function_exists($get_options['process'])) { $options[$get_options['id']] = $get_options['process']($get_options, $options[$get_options['id']]); } } if ($options != $this->options) { // Updates Header Intro Slider Settings foreach ($_POST as $key => $value) { if (preg_match("/custom_slider_/", $key)) { $options[$key] = $value; } } update_option(THEME_SLUG . '_' . $this->name, $options); global $theme_options; $theme_options[$this->name] = $options; wt_generate_skin_css(); } echo '<div id="message" class="updated fade"><p><strong>Updated Successfully</strong></p></div>'; } $this->saved_options = $options; }
function wt_after_theme_is_activated() { if ('themes.php' == basename($_SERVER['PHP_SELF']) && isset($_GET['activated']) && $_GET['activated'] == 'true') { wt_generate_skin_css(); wp_redirect(admin_url('admin.php?page=general')); } }