Make WordPress Core

Changeset 5148


Ignore:
Timestamp:
03/31/2007 05:22:10 AM (18 years ago)
Author:
matt
Message:

Don't dupe categories when adding new ones, use the existing ID.

File:
1 edited

Legend:

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

    r5090 r5148  
    121121    else
    122122        $links_private = 0;
     123
     124    // Let's check if we have this category already, if so just do an update
     125    if ( $cat_ID = $wpdb->get_var( "SELECT cat_ID FROM $wpdb->categories WHERE category_nicename = '$category_nicename' " ) )
     126        $update = true;
    123127
    124128    if (!$update) {
Note: See TracChangeset for help on using the changeset viewer.