Make WordPress Core

Changeset 5559


Ignore:
Timestamp:
05/27/2007 06:29:52 AM (17 years ago)
Author:
ryan
Message:

Delete term if no taxonomies use it. see #4189

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/taxonomy.php

    r5558 r5559  
    165165
    166166    $wpdb->query("DELETE FROM $wpdb->term_taxonomy WHERE term_taxonomy_id = '$tt_id'");
     167
     168    // Delete the term if no taxonomies use it.
     169    if ( !$wpdb->get_var("SELECT COUNT(*) FROM $wpdb->term_taxonomy WHERE term_id = '$term'") )
     170        $wpdb->query("DELETE FROM $wpdb->terms WHERE term_id = '$term'");
    167171
    168172    clean_term_cache($term, $taxonomy);
Note: See TracChangeset for help on using the changeset viewer.