function init() { if (is_admin()) { add_action('admin_menu', array('K2Options', 'add_menu')); // Check for K2 uninstallation. Do here to avoid header output. if ($_GET['page'] == 'k2-options' and isset($_POST['uninstall'])) { K2::uninstall(); } // Need to check if this changes... $sidebar_manager = get_option('k2sidebarmanager'); K2Options::update(); K2Header::update(); // Ewww... if ($sidebar_manager != get_option('k2sidebarmanager')) { header('Location: themes.php?page=k2-options&updated'); exit; } } }
/** * Restores K2 to default settings */ function restore_defaults() { K2::uninstall(); K2::install(); }