WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/24/2012 03:24:31 PM (8 years ago)
Author:
nacin
Message:

Introduce $wpdb->delete(). props justindgivens, scribu. fixes #18948.

File:
1 edited

Legend:

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

    r20023 r20287  
    18031803
    18041804    do_action( 'delete_term_taxonomy', $tt_id );
    1805     $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->term_taxonomy WHERE term_taxonomy_id = %d", $tt_id ) );
     1805    $wpdb->delete( $wpdb->term_taxonomy, array( 'term_taxonomy_id' => $tt_id ) );
    18061806    do_action( 'deleted_term_taxonomy', $tt_id );
    18071807
    18081808    // Delete the term if no taxonomies use it.
    18091809    if ( !$wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_taxonomy WHERE term_id = %d", $term) ) )
    1810         $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->terms WHERE term_id = %d", $term) );
     1810        $wpdb->delete( $wpdb->terms, array( 'term_id' => $term ) );
    18111811
    18121812    clean_term_cache($term, $taxonomy);
Note: See TracChangeset for help on using the changeset viewer.