Make WordPress Core


Ignore:
Timestamp:
05/27/2007 05:15:18 AM (17 years ago)
Author:
ryan
Message:

Fix object term relationship deletion and count updating.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/bookmark.php

    r5542 r5556  
    4545    do_action('delete_link', $link_id);
    4646
    47     $categories = wp_get_link_cats($link_id);
    48     if( is_array( $categories ) ) {
    49         foreach ( $categories as $category ) {
    50             $wpdb->query("UPDATE $wpdb->categories SET link_count = link_count - 1 WHERE cat_ID = '$category'");
    51             wp_cache_delete($category, 'category');
    52             do_action('edit_category', $cat_id);
    53         }
    54     }
     47    wp_delete_object_term_relationships($link_id, 'link_category');
    5548
    56     $wpdb->query("DELETE FROM $wpdb->link2cat WHERE link_id = '$link_id'");
    57     return $wpdb->query("DELETE FROM $wpdb->links WHERE link_id = '$link_id'");
     49    $wpdb->query("DELETE FROM $wpdb->links WHERE link_id = '$link_id'");
    5850   
    5951    do_action('deleted_link', $link_id);
Note: See TracChangeset for help on using the changeset viewer.