WordPress.org

Make WordPress Core

Changeset 11401


Ignore:
Timestamp:
05/19/09 18:08:15 (5 years ago)
Author:
ryan
Message:

Reassign links to default cat when deleting link cats via ajax. fixes #9869

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r11383 r11401  
    243243    $cat_name = get_term_field('name', $id, 'link_category'); 
    244244 
     245    $default = get_option('default_link_category'); 
     246 
    245247    // Don't delete the default cats. 
    246     if ( $id == get_option('default_link_category') ) { 
     248    if ( $id == $default ) { 
    247249        $x = new WP_AJAX_Response( array( 
    248250            'what' => 'link-cat', 
     
    253255    } 
    254256 
    255     $r = wp_delete_term($id, 'link_category'); 
     257    $r = wp_delete_term($id, 'link_category', array('default' => $default)); 
    256258    if ( !$r ) 
    257259        die('0'); 
Note: See TracChangeset for help on using the changeset viewer.