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-admin/includes/ms.php

    r20199 r20287  
    9090        }
    9191
    92         $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->blogs WHERE blog_id = %d", $blog_id ) );
     92        $wpdb->delete( $wpdb->blogs, array( 'blog_id' => $blog_id ) );
     93
    9394        $dir = apply_filters( 'wpmu_delete_blog_upload_dir', WP_CONTENT_DIR . "/blogs.dir/{$blog_id}/files/", $blog_id );
    9495        $dir = rtrim( $dir, DIRECTORY_SEPARATOR );
     
    159160    }
    160161
    161     $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->users WHERE ID = %d", $id ) );
    162     $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->usermeta WHERE user_id = %d", $id ) );
     162    $wpdb->delete( $wpdb->users, array( 'ID' => $id ) );
     163    $wpdb->delete( $wpdb->usermeta, array( 'user_id' => $id ) );
    163164
    164165    clean_user_cache( $id );
Note: See TracChangeset for help on using the changeset viewer.