Make WordPress Core

Ticket #2789: 2789.diff

File 2789.diff, 877 bytes (added by westi, 18 years ago)

Patch for 2.0.4 to fix this

  • wp-admin/admin-db.php

     
    156156        $cat_ID = (int) $cat_ID;
    157157
    158158        // Don't delete the default cat.
    159         if (1 == $cat_ID)
     159        if ($cat_ID == get_option('default_category'))
    160160                return 0;
    161161
    162162        $category = get_category($cat_ID);
  • wp-admin/categories.php

     
    4444
    4545        $cat_name = get_catname($cat_ID);
    4646
    47         if ( 1 == $cat_ID )
     47        // Don't delete the default cats.
     48        if ( $cat_ID == get_option('default_category') )
    4849                die(sprintf(__("Can't delete the <strong>%s</strong> category: this is the default one"), $cat_name));
    4950
    5051        wp_delete_category($cat_ID);