<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[15820] trunk/wp-admin: Get rid of old link category management files.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/15820">15820</a></dd>
<dt>Author</dt> <dd>scribu</dd>
<dt>Date</dt> <dd>2010-10-16 13:26:54 +0000 (Sat, 16 Oct 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Get rid of old link category management files. Fixes <a href="http://trac.wordpress.org/ticket/12285">#12285</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminedittagformphp">trunk/wp-admin/edit-tag-form.php</a></li>
<li><a href="#trunkwpadminedittagsphp">trunk/wp-admin/edit-tags.php</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkwpadmineditlinkcategoriesphp">trunk/wp-admin/edit-link-categories.php</a></li>
<li><a href="#trunkwpadmineditlinkcategoryformphp">trunk/wp-admin/edit-link-category-form.php</a></li>
<li><a href="#trunkwpadminlinkcategoryphp">trunk/wp-admin/link-category.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadmineditlinkcategoriesphp"></a>
<div class="delfile"><h4>Deleted: trunk/wp-admin/edit-link-categories.php (15819 => 15820)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-link-categories.php        2010-10-15 19:44:57 UTC (rev 15819)
+++ trunk/wp-admin/edit-link-categories.php        2010-10-16 13:26:54 UTC (rev 15820)
</span><span class="lines">@@ -1,237 +0,0 @@
</span><del>-<?php
-/**
- * Edit Link Categories Administration Panel.
- *
- * @package WordPress
- * @subpackage Administration
- */
-
-/** WordPress Administration Bootstrap */
-require_once('./admin.php');
-
-// Handle bulk actions
-if ( isset($_GET['action']) && isset($_GET['delete']) ) {
-        check_admin_referer('bulk-link-categories');
-        $doaction = $_GET['action'] ? $_GET['action'] : $_GET['action2'];
-
-        if ( !current_user_can('manage_categories') )
-                wp_die(__('Cheatin&#8217; uh?'));
-
-        if ( 'delete' == $doaction ) {
-                $cats = (array) $_GET['delete'];
-                $default_cat_id = get_option('default_link_category');
-
-                foreach( $cats as $cat_ID ) {
-                        $cat_ID = (int) $cat_ID;
-                        // Don't delete the default cats.
-                        if ( $cat_ID == $default_cat_id )
-                                wp_die( sprintf( __("Can&#8217;t delete the <strong>%s</strong> category: this is the default one"), get_term_field('name', $cat_ID, 'link_category') ) );
-
-                        wp_delete_term($cat_ID, 'link_category', array('default' => $default_cat_id));
-                }
-
-                $location = 'edit-link-categories.php';
-                if ( $referer = wp_get_referer() ) {
-                        if ( false !== strpos($referer, 'edit-link-categories.php') )
-                                $location = $referer;
-                }
-
-                $location = add_query_arg('message', 6, $location);
-                wp_redirect($location);
-                exit();
-        }
-} elseif ( ! empty($_GET['_wp_http_referer']) ) {
-         wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
-         exit;
-}
-
-$title = __('Link Categories');
-
-wp_enqueue_script('admin-categories');
-if ( current_user_can('manage_categories') )
-        wp_enqueue_script('inline-edit-tax');
-
-add_contextual_help($current_screen, '<p>' . __('You can create groups of links by using link categories. Link category names must be unique and link categories are separate from the categories you use for posts.') . '</p>' .
-        '<p>' . __('You can delete link categories, but that action does not delete the links within the category. Instead, it moves them to the default link category.') . '</p>' .
-        '<p><strong>' . __('For more information:') . '</strong></p>' .
-        '<p>' . __('<a href="http://codex.wordpress.org/Links_Link_Categories_SubPanel" target="_blank">Link Categories Documentation</a>') . '</p>' .
-        '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
-);
-
-require_once ('admin-header.php');
-
-$messages[1] = __('Category added.');
-$messages[2] = __('Category deleted.');
-$messages[3] = __('Category updated.');
-$messages[4] = __('Category not added.');
-$messages[5] = __('Category not updated.');
-$messages[6] = __('Categories deleted.'); ?>
-
-<div class="wrap nosubsub">
-<?php screen_icon(); ?>
-<h2><?php echo esc_html( $title );
-if ( isset($_GET['s']) && $_GET['s'] )
-        printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( stripslashes($_GET['s']) ) ); ?>
-</h2>
-
-<?php if ( isset($_GET['message']) && ( $msg = (int) $_GET['message'] ) ) : ?>
-<div id="message" class="updated"><p><?php echo $messages[$msg]; ?></p></div>
-<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
-endif; ?>
-
-<form class="search-form" action="" method="get">
-<p class="search-box">
-        <label class="screen-reader-text" for="link-category-search-input"><?php _e( 'Search Categories' ); ?>:</label>
-        <input type="text" id="link-category-search-input" name="s" value="<?php _admin_search_query(); ?>" />
-        <input type="submit" value="<?php esc_attr_e( 'Search Categories' ); ?>" class="button" />
-</p>
-</form>
-<br class="clear" />
-
-<div id="col-container">
-
-<div id="col-right">
-<div class="col-wrap">
-<form id="posts-filter" action="" method="get">
-<div class="tablenav">
-
-<?php
-$pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0;
-if ( empty($pagenum) )
-        $pagenum = 1;
-if ( ! isset( $catsperpage ) || $catsperpage < 0 )
-        $catsperpage = 20;
-
-$page_links = paginate_links( array(
-        'base' => add_query_arg( 'pagenum', '%#%' ),
-        'format' => '',
-        'prev_text' => __('&laquo;'),
-        'next_text' => __('&raquo;'),
-        'total' => ceil(wp_count_terms('link_category') / $catsperpage),
-        'current' => $pagenum
-));
-
-if ( $page_links )
-        echo "<div class='tablenav-pages'>$page_links</div>";
-?>
-
-<div class="alignleft actions">
-<select name="action">
-<option value="" selected="selected"><?php _e('Bulk Actions'); ?></option>
-<option value="delete"><?php _e('Delete'); ?></option>
-</select>
-<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
-<?php wp_nonce_field('bulk-link-categories'); ?>
-</div>
-
-<br class="clear" />
-</div>
-
-<div class="clear"></div>
-
-<table class="widefat fixed" cellspacing="0">
-        <thead>
-        <tr>
-<?php print_column_headers('edit-link-categories'); ?>
-        </tr>
-        </thead>
-
-        <tfoot>
-        <tr>
-<?php print_column_headers('edit-link-categories', false); ?>
-        </tr>
-        </tfoot>
-
-        <tbody id="the-list" class="list:link-cat">
-<?php
-$start = ($pagenum - 1) * $catsperpage;
-$args = array('offset' => $start, 'number' => $catsperpage, 'hide_empty' => 0);
-if ( !empty( $_GET['s'] ) )
-        $args['search'] = $_GET['s'];
-
-$categories = get_terms( 'link_category', $args );
-if ( $categories ) {
-        $output = '';
-        foreach ( $categories as $category ) {
-                $output .= link_cat_row($category);
-        }
-        echo $output;
-        unset($category);
-}
-
-?>
-        </tbody>
-</table>
-
-<div class="tablenav">
-<?php
-if ( $page_links )
-        echo "<div class='tablenav-pages'>$page_links</div>";
-?>
-
-<div class="alignleft actions">
-<select name="action2">
-<option value="" selected="selected"><?php _e('Bulk Actions'); ?></option>
-<option value="delete"><?php _e('Delete'); ?></option>
-</select>
-<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
-</div>
-
-<br class="clear" />
-</div>
-<br class="clear" />
-</form>
-
-<div class="form-wrap">
-<p><?php printf(__('<strong>Note:</strong><br />Deleting a category does not delete the links in that category. Instead, links that were only assigned to the deleted category are set to the category <strong>%s</strong>.'), get_term_field('name', get_option('default_link_category'), 'link_category')) ?></p>
-</div>
-
-
-</div>
-</div><!-- /col-right -->
-
-<div id="col-left">
-<div class="col-wrap">
-
-<?php if ( current_user_can('manage_categories') ) {
-        $category = (object) array(); $category->parent = 0; do_action('add_link_category_form_pre', $category); ?>
-
-<div class="form-wrap">
-<h3><?php _e('Add Link Category'); ?></h3>
-<div id="ajax-response"></div>
-<form name="addcat" id="addcat" class="add:the-list: validate" method="post" action="link-category.php">
-<input type="hidden" name="action" value="addcat" />
-<?php wp_original_referer_field(true, 'previous'); wp_nonce_field('add-link-category'); ?>
-
-<div class="form-field form-required">
-        <label for="name"><?php _e('Link Category name') ?></label>
-        <input name="name" id="link-name" type="text" value="" size="40" aria-required="true" />
-</div>
-<?php if ( !global_terms_enabled() ) { ?>
-<div class="form-field">
-        <label for="slug"><?php _e('Link Category slug') ?></label>
-        <input name="slug" id="link-slug" type="text" value="" size="40" />
-        <p><?php _e('The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p>
-</div>
-<?php } ?>
-<div class="form-field">
-        <label for="description"><?php _e('Description (optional)') ?></label>
-        <textarea name="description" id="link-description" rows="5" cols="40"></textarea>
-        <p><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></p>
-</div>
-
-<p class="submit"><input type="submit" class="button" name="submit" value="<?php esc_attr_e('Add Category'); ?>" /></p>
-<?php do_action('edit_link_category_form', $category); ?>
-</form>
-</div>
-
-<?php } ?>
-
-</div>
-</div><!-- /col-left -->
-
-</div><!-- /col-container -->
-</div><!-- /wrap -->
-
-<?php inline_edit_term_row('edit-link-categories', 'link_category'); ?>
-<?php include('./admin-footer.php'); ?>
</del></span></pre></div>
<a id="trunkwpadmineditlinkcategoryformphp"></a>
<div class="delfile"><h4>Deleted: trunk/wp-admin/edit-link-category-form.php (15819 => 15820)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-link-category-form.php        2010-10-15 19:44:57 UTC (rev 15819)
+++ trunk/wp-admin/edit-link-category-form.php        2010-10-16 13:26:54 UTC (rev 15820)
</span><span class="lines">@@ -1,92 +0,0 @@
</span><del>-<?php
-/**
- * Edit link category form for inclusion in administration panels.
- *
- * @package WordPress
- * @subpackage Administration
- */
-
-// don't load directly
-if ( !defined('ABSPATH') )
-        die('-1');
-
-if ( !current_user_can('manage_categories') )
-        wp_die(__('You do not have sufficient permissions to edit link categories for this site.'));
-
-/**
- * @var object
- */
-if ( ! isset( $category ) )
-        $category = (object) array();
-
-if ( ! empty($cat_ID) ) {
-        /**
-         * @var string
-         */
-        $heading = '<h2>' . __('Edit Link Category') . '</h2>';
-        $submit_text = __('Update Category');
-        $form = '<form name="editcat" id="editcat" method="post" action="link-category.php" class="validate">';
-        $action = 'editedcat';
-        $nonce_action = 'update-link-category_' . $cat_ID;
-        do_action('edit_link_category_form_pre', $category);
-} else {
-        $heading = '<h2>' . __('Add Link Category') . '</h2>';
-        $submit_text = __('Add Category');
-        $form = '<form name="addcat" id="addcat" class="add:the-list: validate" method="post" action="link-category.php">';
-        $action = 'addcat';
-        $nonce_action = 'add-link-category';
-        do_action('add_link_category_form_pre', $category);
-}
-
-/**
- * @ignore
- * @since 2.7
- * @internal Used to prevent errors in page when no category is being edited.
- *
- * @param object $category
- */
-function _fill_empty_link_category(&$category) {
-        if ( ! isset( $category->name ) )
-                $category->name = '';
-
-        if ( ! isset( $category->slug ) )
-                $category->slug = '';
-
-        if ( ! isset( $category->description ) )
-                $category->description = '';
-}
-
-_fill_empty_link_category($category);
-?>
-
-<div class="wrap">
-<?php screen_icon(); ?>
-<?php echo $heading ?>
-<div id="ajax-response"></div>
-<?php echo $form ?>
-<input type="hidden" name="action" value="<?php echo esc_attr($action) ?>" />
-<input type="hidden" name="cat_ID" value="<?php echo esc_attr($category->term_id) ?>" />
-<?php wp_original_referer_field(true, 'previous'); wp_nonce_field($nonce_action); ?>
-        <table class="form-table">
-                <tr class="form-field form-required">
-                        <th scope="row" valign="top"><label for="name"><?php _e('Link Category name') ?></label></th>
-                        <td><input name="name" id="name" type="text" value="<?php echo esc_attr($category->name); ?>" size="40" aria-required="true" /></td>
-                </tr>
-<?php if ( !is_multisite() ) { ?>
-                <tr class="form-field">
-                        <th scope="row" valign="top"><label for="slug"><?php _e('Link Category slug') ?></label></th>
-                        <td><input name="slug" id="slug" type="text" value="<?php echo esc_attr(apply_filters('editable_slug', $category->slug)); ?>" size="40" /><br />
- <?php _e('The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></td>
-                </tr>
-<?php } ?>
-                <tr class="form-field">
-                        <th scope="row" valign="top"><label for="description"><?php _e('Description (optional)') ?></label></th>
-                        <td><textarea name="description" id="description" rows="5" cols="50" style="width: 97%;"><?php echo $category->description; ?></textarea><br />
-                        <span class="description"><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></span></td>
-                </tr>
-                <?php do_action('edit_link_category_form_fields', $category); ?>
-        </table>
-<p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php echo esc_attr($submit_text) ?>" /></p>
-<?php do_action('edit_link_category_form', $category); ?>
-</form>
-</div>
</del></span></pre></div>
<a id="trunkwpadminedittagformphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-tag-form.php (15819 => 15820)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-tag-form.php        2010-10-15 19:44:57 UTC (rev 15819)
+++ trunk/wp-admin/edit-tag-form.php        2010-10-16 13:26:54 UTC (rev 15820)
</span><span class="lines">@@ -16,10 +16,14 @@
</span><span class="cx">         return;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+// Back compat hooks
</ins><span class="cx"> if ( 'category' == $taxonomy )
</span><span class="cx">         do_action('edit_category_form_pre', $tag );
</span><ins>+elseif ( 'link_category' == $taxonomy )
+        do_action('edit_link_category_form_pre', $tag );
</ins><span class="cx"> else
</span><span class="cx">         do_action('edit_tag_form_pre', $tag);
</span><ins>+
</ins><span class="cx"> do_action($taxonomy . '_pre_edit_form', $tag, $taxonomy); ?>
</span><span class="cx">
</span><span class="cx"> <div class="wrap">
</span><span class="lines">@@ -61,18 +65,26 @@
</span><span class="cx">                         <span class="description"><?php _e('The description is not prominent by default, however some themes may show it.'); ?></span></td>
</span><span class="cx">                 </tr>
</span><span class="cx">                 <?php
</span><ins>+                // Back compat hooks
</ins><span class="cx">                 if ( 'category' == $taxonomy )
</span><span class="cx">                         do_action('edit_category_form_fields', $tag);
</span><ins>+                if ( 'link_category' == $taxonomy )
+                        do_action('edit_link_category_form_fields', $tag);
</ins><span class="cx">                 else
</span><span class="cx">                         do_action('edit_tag_form_fields', $tag);
</span><ins>+
</ins><span class="cx">                 do_action($taxonomy . '_edit_form_fields', $tag, $taxonomy);
</span><span class="cx">                 ?>
</span><span class="cx">         </table>
</span><span class="cx"> <?php
</span><ins>+// Back compat hooks
</ins><span class="cx"> if ( 'category' == $taxonomy )
</span><span class="cx">         do_action('edit_category_form', $tag);
</span><ins>+if ( 'link_category' == $taxonomy )
+        do_action('edit_link_category_form', $tag);
</ins><span class="cx"> else
</span><span class="cx">         do_action('edit_tag_form', $tag);
</span><ins>+
</ins><span class="cx"> do_action($taxonomy . '_edit_form', $tag, $taxonomy);
</span><span class="cx"> ?>
</span><span class="cx"> <p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php echo esc_attr( __( 'Update' ) ); ?>" /></p>
</span></span></pre></div>
<a id="trunkwpadminedittagsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-tags.php (15819 => 15820)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-tags.php        2010-10-15 19:44:57 UTC (rev 15819)
+++ trunk/wp-admin/edit-tags.php        2010-10-16 13:26:54 UTC (rev 15820)
</span><span class="lines">@@ -283,10 +283,14 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ( current_user_can($tax->cap->edit_terms) ) {
</span><ins>+        // Back compat hooks. Deprecated in preference to {$taxonomy}_pre_add_form
</ins><span class="cx">         if ( 'category' == $taxonomy )
</span><del>-                do_action('add_category_form_pre', (object)array('parent' => 0) ); // Back compat hook. Deprecated in preference to $taxonomy_pre_add_form
</del><ins>+                do_action('add_category_form_pre', (object)array('parent' => 0) );
+        elseif ( 'link_category' == $taxonomy )
+                do_action('add_link_category_form_pre', (object)array('parent' => 0) );
</ins><span class="cx">         else
</span><del>-                do_action('add_tag_form_pre', $taxonomy); // Back compat hook. Applies to all Taxonomies -not- categories
</del><ins>+                do_action('add_tag_form_pre', $taxonomy);
+
</ins><span class="cx">         do_action($taxonomy . '_pre_add_form', $taxonomy);
</span><span class="cx"> ?>
</span><span class="cx">
</span><span class="lines">@@ -333,10 +337,14 @@
</span><span class="cx"> ?>
</span><span class="cx"> <p class="submit"><input type="submit" class="button" name="submit" id="submit" value="<?php echo esc_attr( $tax->labels->add_new_item ); ?>" /></p>
</span><span class="cx"> <?php
</span><ins>+// Back compat hooks. Deprecated in preference to {$taxonomy}_add_form
</ins><span class="cx"> if ( 'category' == $taxonomy )
</span><del>-        do_action('edit_category_form',        (object)array('parent' => 0) ); // Back compat hook. Deprecated in preference to $taxonomy_add_form
</del><ins>+        do_action('add_category_form', (object)array('parent' => 0) );
+elseif ( 'link_category' == $taxonomy )
+        do_action('add_link_category_form', (object)array('parent' => 0) );
</ins><span class="cx"> else
</span><del>-        do_action('add_tag_form', $taxonomy); // Back compat hook. Applies to all Taxonomies -not- categories
</del><ins>+        do_action('add_tag_form', $taxonomy);
+
</ins><span class="cx"> do_action($taxonomy . '_add_form', $taxonomy);
</span><span class="cx"> ?>
</span><span class="cx"> </form></div>
</span></span></pre></div>
<a id="trunkwpadminlinkcategoryphp"></a>
<div class="delfile"><h4>Deleted: trunk/wp-admin/link-category.php (15819 => 15820)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/link-category.php        2010-10-15 19:44:57 UTC (rev 15819)
+++ trunk/wp-admin/link-category.php        2010-10-16 13:26:54 UTC (rev 15820)
</span><span class="lines">@@ -1,100 +0,0 @@
</span><del>-<?php
-/**
- * Manage link category administration actions.
- *
- * This page is accessed by the link management pages and handles the forms and
- * AJAX processes for category actions.
- *
- * @package WordPress
- * @subpackage Administration
- */
-
-/** Load WordPress Administration Bootstrap */
-require_once('./admin.php');
-
-wp_reset_vars(array('action', 'cat'));
-
-switch($action) {
-
-case 'addcat':
-
-        check_admin_referer('add-link-category');
-
-        if ( !current_user_can('manage_categories') )
-                wp_die(__('Cheatin&#8217; uh?'));
-
-        if ( wp_insert_term($_POST['name'], 'link_category', $_POST ) ) {
-                wp_redirect('edit-link-categories.php?message=1#addcat');
-        } else {
-                wp_redirect('edit-link-categories.php?message=4#addcat');
-        }
-        exit;
-break;
-
-case 'delete':
-        $cat_ID = (int) $_GET['cat_ID'];
-        check_admin_referer('delete-link-category_' . $cat_ID);
-
-        if ( !current_user_can('manage_categories') )
-                wp_die(__('Cheatin&#8217; uh?'));
-
-        $cat_name = get_term_field('name', $cat_ID, 'link_category');
-        $default_cat_id = get_option('default_link_category');
-
-        // Don't delete the default cats.
-        if ( $cat_ID == $default_cat_id )
-                wp_die(sprintf(__("Can&#8217;t delete the <strong>%s</strong> 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&#8217; 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;
-}
-
-?>
</del></span></pre>
</div>
</div>
</body>
</html>