%s category: this is the default one"), $cat_name)); wp_delete_term($cat_ID, 'link_category', array('default' => $default_cat_id)); $location = 'edit-link-categories.php'; if ( $referer = wp_get_original_referer() ) { if ( false !== strpos($referer, 'edit-link-categories.php') ) $location = $referer; } $location = add_query_arg('message', 2, $location); wp_redirect($location); exit; break; case 'edit': $title = __('Edit Category'); $parent_file = 'link-manager.php'; $submenu_file = 'edit-link-categories.php'; require_once ('admin-header.php'); $cat_ID = (int) $_GET['cat_ID']; $category = get_term_to_edit($cat_ID, 'link_category'); include('./edit-link-category-form.php'); include('./admin-footer.php'); exit; break; case 'editedcat': $cat_ID = (int) $_POST['cat_ID']; check_admin_referer('update-link-category_' . $cat_ID); if ( !current_user_can('manage_categories') ) wp_die(__('Cheatin’ uh?')); $location = 'edit-link-categories.php'; if ( $referer = wp_get_original_referer() ) { if ( false !== strpos($referer, 'edit-link-categories.php') ) $location = $referer; } $update = wp_update_term($cat_ID, 'link_category', $_POST); if ( $update && !is_wp_error($update) ) $location = add_query_arg('message', 3, $location); else $location = add_query_arg('message', 5, $location); wp_redirect($location); exit; break; } ?>