foreach( (array) $_GET['delete'] as $cat_ID ) {
$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 == get_option('default_link_category') )
+ if ( $cat_ID == $default_cat_id )
wp_die(sprintf(__("Can’t delete the <strong>%s</strong> category: this is the default one"), $cat_name));
- wp_delete_term($cat_ID, 'link_category');
+ wp_delete_term($cat_ID, 'link_category', array('default' => $default_cat_id));
}
$location = 'edit-link-categories.php';
<?php endif; ?>
<p id="post-search">
+ <label class="hidden" for="post-search-input"><?php _e( 'Search Categories' ); ?>:</label>
<input type="text" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" />
<input type="submit" value="<?php _e( 'Search Categories' ); ?>" class="button" />
</p>
<table class="widefat">
<thead>
<tr>
- <th scope="col" class="check-column"><input type="checkbox" onclick="checkAll(document.getElementById('posts-filter'));" /></th>
+ <th scope="col" class="check-column"><input type="checkbox" /></th>
<th scope="col"><?php _e('Name') ?></th>
<th scope="col"><?php _e('Description') ?></th>
<th scope="col" class="num" style="width: 90px;"><?php _e('Links') ?></th>