function mytheme_add_admin() { global $kampylefeedback, $themename, $shortname, $options; if ($_GET['page'] == 'theme_settings') { if ('save' == $_REQUEST['action']) { foreach ($options as $value) { if ($value['type'] != 'multicheck') { update_option($value['id'], $_REQUEST[$value['id']]); } else { foreach ($value['options'] as $mc_key => $mc_value) { $up_opt = $value['id'] . '_' . $mc_key; update_option($up_opt, $_REQUEST[$up_opt]); } } } foreach ($options as $value) { if ($value['type'] != 'multicheck') { if (isset($_REQUEST[$value['id']])) { update_option($value['id'], $_REQUEST[$value['id']]); } else { delete_option($value['id']); } } else { foreach ($value['options'] as $mc_key => $mc_value) { $up_opt = $value['id'] . '_' . $mc_key; if (isset($_REQUEST[$up_opt])) { update_option($up_opt, $_REQUEST[$up_opt]); } else { delete_option($up_opt); } } } } header("Location: admin.php?page=theme_settings&saved=true"); die; } else { if ('reset' == $_REQUEST['action']) { foreach ($options as $value) { if ($value['type'] != 'multicheck') { delete_option($value['id']); } else { foreach ($value['options'] as $mc_key => $mc_value) { $del_opt = $value['id'] . '_' . $mc_key; delete_option($del_opt); } } } //header("Location: themes.php?page=functions.php&reset=true"); header("Location: admin.php?page=theme_settings&saved=true"); die; } } } //add_theme_page($themename." Options", "$themename Theme Options", 'edit_themes', 'functions.php', 'mytheme_admin'); // mytheme_wp_head(); mytheme_admin_head(); mytheme_admin(); /*global $options_child; if($options_child) { mytheme_admin_child(); }*/ }
function personality_test_setting() { mytheme_admin(); }