Make WordPress Core


Ignore:
Timestamp:
07/21/2008 04:13:37 PM (16 years ago)
Author:
ryan
Message:

Fix assignment of links to the default category when a category is deleted. Props scohoust. fixes #7316 for 2.6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.6/wp-admin/link-category.php

    r7537 r8389  
    2929
    3030    $cat_name = get_term_field('name', $cat_ID, 'link_category');
     31    $default_cat_id = get_option('default_link_category');
    3132
    3233    // Don't delete the default cats.
    33     if ( $cat_ID == get_option('default_link_category') )
     34    if ( $cat_ID == $default_cat_id )
    3435        wp_die(sprintf(__("Can&#8217;t delete the <strong>%s</strong> category: this is the default one"), $cat_name));
    3536
    36     wp_delete_term($cat_ID, 'link_category');
     37    wp_delete_term($cat_ID, 'link_category', array('default' => $default_cat_id));
    3738
    3839    $location = 'edit-link-categories.php';
Note: See TracChangeset for help on using the changeset viewer.