Index: wp-includes/taxonomy.php
===================================================================
--- wp-includes/taxonomy.php	(revision 19024)
+++ wp-includes/taxonomy.php	(working copy)
@@ -1765,12 +1765,12 @@
 		clean_object_term_cache( $objects, $object_type );
 
 	do_action( 'delete_term_taxonomy', $tt_id );
-	$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->term_taxonomy WHERE term_taxonomy_id = %d", $tt_id ) );
+	$wpdb->delete( "$wpdb->term_taxonomy" , array( "term_taxonomy_id" => $tt_id ) , array( '%d' ) );
 	do_action( 'deleted_term_taxonomy', $tt_id );
 
 	// Delete the term if no taxonomies use it.
 	if ( !$wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_taxonomy WHERE term_id = %d", $term) ) )
-		$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->terms WHERE term_id = %d", $term) );
+		$wpdb->delete( "$wpdb->terms" , array( "term_id" => $term ) , array( '%d' ) );
 
 	clean_term_cache($term, $taxonomy);
 
Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(revision 19024)
+++ wp-includes/post.php	(working copy)
@@ -2031,7 +2031,7 @@
 	}
 
 	do_action( 'delete_post', $postid );
-	$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->posts WHERE ID = %d", $postid ));
+	$wpdb->delete( "$wpdb->posts" , array( "ID" => $postid ) , array( '%d' ) );
 	do_action( 'deleted_post', $postid );
 
 	if ( 'page' == $post->post_type ) {
@@ -3783,7 +3783,7 @@
 	wp_delete_object_term_relationships($post_id, array('category', 'post_tag'));
 	wp_delete_object_term_relationships($post_id, get_object_taxonomies($post->post_type));
 
-	$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_thumbnail_id' AND meta_value = %d", $post_id ));
+	$wpdb->delete( "$wpdb->postmeta" , array( "meta_key" => '_thumbnail_id' , "meta_value" => $post_id ) , array( '%s' , '%d' ) );
 
 	$comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d", $post_id ));
 	if ( ! empty( $comment_ids ) ) {
@@ -3802,7 +3802,7 @@
 	}
 
 	do_action( 'delete_post', $post_id );
-	$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->posts WHERE ID = %d", $post_id ));
+	$wpdb->delete( "$wpdb->posts" , array( "ID" => $post_id ) , array( '%d' ) );
 	do_action( 'deleted_post', $post_id );
 
 	$uploadpath = wp_upload_dir();
Index: wp-includes/comment.php
===================================================================
--- wp-includes/comment.php	(revision 19024)
+++ wp-includes/comment.php	(working copy)
@@ -970,7 +970,7 @@
 		do_action( 'deleted_commentmeta', $meta_ids );
 	}
 
-	if ( ! $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->comments WHERE comment_ID = %d LIMIT 1", $comment_id) ) )
+	if ( ! $wpdb->delete( "$wpdb->comments" , array( "comment_ID" => $comment_id ) , array( '%d' ) , 1 ); )
 		return false;
 	do_action('deleted_comment', $comment_id);
 
Index: wp-includes/functions.php
===================================================================
--- wp-includes/functions.php	(revision 19024)
+++ wp-includes/functions.php	(working copy)
@@ -665,7 +665,7 @@
 	if ( is_null( $row ) )
 		return false;
 	do_action( 'delete_option', $option );
-	$result = $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->options WHERE option_name = %s", $option) );
+	$result = $wpdb->delete( "$wpdb->options" , array( "option_name" => $option) , array( '%s' ) );
 	if ( ! defined( 'WP_INSTALLING' ) ) {
 		if ( 'yes' == $row->autoload ) {
 			$alloptions = wp_load_alloptions();
@@ -3890,7 +3890,7 @@
 		$cache_key = "{$wpdb->siteid}:$option";
 		wp_cache_delete( $cache_key, 'site-options' );
 
-		$result = $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->sitemeta} WHERE meta_key = %s AND site_id = %d", $option, $wpdb->siteid ) );
+		$result = $wpdb->delete( "{$wpdb->sitemeta}" , array( "meta_key" => $option , "site_id" => $wpdb->siteid ) , array( '%s' , '%d' ) );
 	}
 
 	if ( $result ) {
Index: wp-includes/wp-db.php
===================================================================
--- wp-includes/wp-db.php	(revision 19024)
+++ wp-includes/wp-db.php	(working copy)
@@ -409,6 +409,7 @@
 	 * @see wpdb:prepare()
 	 * @see wpdb:insert()
 	 * @see wpdb:update()
+	 * @see wpdb:delete()
 	 * @see wp_set_wpdb_vars()
 	 * @access public
 	 * @var array
@@ -1252,7 +1253,55 @@
 		$sql = "UPDATE `$table` SET " . implode( ', ', $bits ) . ' WHERE ' . implode( ' AND ', $wheres );
 		return $this->query( $this->prepare( $sql, array_merge( array_values( $data ), array_values( $where ) ) ) );
 	}
+	
+	/**
+	 * Delete a row in the table
+	 *
+	 * <code>
+	 * wpdb::delete( 'table', array( 'ID' => 1 ) )
+	 * wpdb::delete( 'table', array( 'ID' => 1 ), array( '%d' ) )
+	 * wpdb::delete( 'table', array( 'ID' => 1 ), array( '%d' ), 1 )
+	 * </code>
+	 *
+	 * @since 2.5.0
+	 * @see wpdb::prepare()
+	 * @see wpdb::$field_types
+	 * @see wp_set_wpdb_vars()
+	 *
+	 * @param string $table table name
+	 * @param array $where A named array of WHERE clauses (in column => value pairs). Multiple clauses will be joined with ANDs. Both $where columns and $where values should be "raw".
+	 * @param array|string $where_format Optional. An array of formats to be mapped to each of the values in $where. If string, that format will be used for all of the items in $where.  A format is one of '%d', '%f', '%s' (integer, float, string).  If omitted, all values in $where will be treated as strings.
+	 * 	A format is one of '%d', '%f', '%s' (integer, float, string). If omitted, all values in $where will be treated as strings unless otherwise specified in wpdb::$field_types.
+	 * @param int $limit to number of rows to delete.
+	 * @return int|false The number of rows updated, or false on error.
+	 */
+	function delete( $table, $where, $where_format = null, $limit = null) {
+		if ( ! is_array( $where ) )
+			return false;
+		
+		$bits = $wheres = array();
 
+		$where_formats = $where_format = (array) $where_format;
+		foreach ( (array) array_keys( $where ) as $field ) {
+			if ( !empty( $where_format ) )
+				$form = ( $form = array_shift( $where_formats ) ) ? $form : $where_format[0];
+			elseif ( isset( $this->field_types[$field] ) )
+				$form = $this->field_types[$field];
+			else
+				$form = '%s';
+			$wheres[] = "`$field` = {$form}";
+		}
+		$limits = '';
+		if (!empty($limit) {
+			if (is_int($limit))
+				$limits = ' LIMIT ' . $limit;
+		}
+		
+		$sql = "DELETE FROM `$table` WHERE " . implode( ' AND ', $wheres ) . $limits;
+		return $this->query( $this->prepare( $sql, $where ) );
+	}
+	
+	
 	/**
 	 * Retrieve one variable from the database.
 	 *
Index: wp-includes/deprecated.php
===================================================================
--- wp-includes/deprecated.php	(revision 19024)
+++ wp-includes/deprecated.php	(working copy)
@@ -2292,9 +2292,9 @@
 		do_action( 'delete_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );
 
 	if ( ! empty($meta_value) )
-		$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s AND meta_value = %s", $user_id, $meta_key, $meta_value) );
+		$wpdb->delete( "$wpdb->usermeta" , array( "user_id" => $user_id , "meta_key" => $meta_key , "meta_value" => $meta_value ) , array( '%d' , '%s' , '%s' ) );
 	else
-		$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) );
+		$wpdb->delete( "$wpdb->usermeta" , array( "user_id" => $user_id , "meta_key" => $meta_key ) , array( '%d' , '%s' ) );
 
 	clean_user_cache( $user_id );
 	wp_cache_delete( $user_id, 'user_meta' );
Index: wp-includes/ms-functions.php
===================================================================
--- wp-includes/ms-functions.php	(revision 19024)
+++ wp-includes/ms-functions.php	(working copy)
@@ -498,7 +498,7 @@
 		$diff = $now - $registered_at;
 		// If registered more than two days ago, cancel registration and let this signup go through.
 		if ( $diff > 172800 )
-			$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->signups WHERE user_login = %s", $user_name) );
+			$wpdb->delete( "$wpdb->signups" , array( "user_login" => $user_name ) , array( '%s' ) );
 		else
 			$errors->add('user_name', __('That username is currently reserved but may be available in a couple of days.'));
 
@@ -511,7 +511,7 @@
 		$diff = current_time( 'timestamp', true ) - mysql2date('U', $signup->registered);
 		// If registered more than two days ago, cancel registration and let this signup go through.
 		if ( $diff > 172800 )
-			$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->signups WHERE user_email = %s", $user_email) );
+			$wpdb->delete( "$wpdb->signups" , array( "user_email" => $user_email ) , array( '%s' ) );
 		else
 			$errors->add('user_email', __('That email address has already been used. Please check your inbox for an activation email. It will become available in a couple of days if you do nothing.'));
 	}
@@ -614,7 +614,7 @@
 		$diff = current_time( 'timestamp', true ) - mysql2date('U', $signup->registered);
 		// If registered more than two days ago, cancel registration and let this signup go through.
 		if ( $diff > 172800 )
-			$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->signups WHERE domain = %s AND path = %s", $mydomain, $path) );
+			$wpdb->delete( "$wpdb->signups" , array( "domain" => $mydomain , "path" => $path ) , array( '%s' , '%s' ) );
 		else
 			$errors->add('blogname', __('That site is currently reserved but may be available in a couple days.'));
 	}
@@ -1161,8 +1161,9 @@
 	$wpdb->update( $wpdb->options, array('option_value' => ''), array('option_name' => 'admin_email') );
 
 	// remove all perms
-	$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE meta_key = %s", $table_prefix.'user_level') );
-	$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE meta_key = %s", $table_prefix.'capabilities') );
+	$wpdb->delete( "$wpdb->usermeta" , array( "meta_key" => $table_prefix.'user_level' ) , array( '%s' ) );
+	
+	$wpdb->delete( "$wpdb->usermeta" , array( "meta_key" => $table_prefix.'capabilities' ) , array( '%s' ) );
 
 	$wpdb->suppress_errors( false );
 }
Index: wp-includes/meta.php
===================================================================
--- wp-includes/meta.php	(revision 19024)
+++ wp-includes/meta.php	(working copy)
@@ -489,7 +489,7 @@
 			do_action( 'delete_postmeta', $meta_id );
 
 		// Run the query, will return true if deleted, false otherwise
-		$result = (bool) $wpdb->query( $wpdb->prepare( "DELETE FROM $table WHERE $id_column = %d LIMIT 1;", $meta_id ) );
+		$result = (bool) $wpdb->delete( "$table" , array( "$id_column" => $meta_id ) , array( '%d' ) , 1 );
 
 		// Clear the caches.
 		wp_cache_delete($object_id, $meta_type . '_meta');
Index: wp-admin/includes/bookmark.php
===================================================================
--- wp-admin/includes/bookmark.php	(revision 19024)
+++ wp-admin/includes/bookmark.php	(working copy)
@@ -83,7 +83,7 @@
 
 	wp_delete_object_term_relationships( $link_id, 'link_category' );
 
-	$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->links WHERE link_id = %d", $link_id ) );
+	$wpdb->delete( "$wpdb->links" , array( 'link_id' => $link_id ) , array ( '%d' ) );
 
 	do_action( 'deleted_link', $link_id );
 
Index: wp-admin/includes/upgrade.php
===================================================================
--- wp-admin/includes/upgrade.php	(revision 19024)
+++ wp-admin/includes/upgrade.php	(working copy)
@@ -297,7 +297,7 @@
 
 		// Delete any caps that snuck into the previously active blog. (Hardcoded to blog 1 for now.) TODO: Get previous_blog_id.
 		if ( !is_super_admin( $user_id ) && $user_id != 1 )
-			$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $wpdb->base_prefix.'1_capabilities') );
+			$wpdb->delete( "$wpdb->usermeta" , array( "user_id" => $user_id , "meta_key" => $wpdb->base_prefix.'1_capabilities' ) , array( '%d' , '%s' ) );
 	}
 }
 endif;
Index: wp-admin/includes/schema.php
===================================================================
--- wp-admin/includes/schema.php	(revision 19024)
+++ wp-admin/includes/schema.php	(working copy)
@@ -513,7 +513,7 @@
 		delete_option($option);
 
 	// delete obsolete magpie stuff
-	$wpdb->query("DELETE FROM $wpdb->options WHERE option_name REGEXP '^rss_[0-9a-f]{32}(_ts)?$'");
+	$wpdb->delete( "$wpdb->options" , array( 'option_name' => "REGEXP '^rss_[0-9a-f]{32}(_ts)?$'" ) , array( '%s' ) );
 }
 
 /**
Index: wp-admin/includes/user.php
===================================================================
--- wp-admin/includes/user.php	(revision 19024)
+++ wp-admin/includes/user.php	(working copy)
@@ -292,11 +292,11 @@
 
 	// FINALLY, delete user
 	if ( !is_multisite() ) {
-		$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d", $id) );
-		$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->users WHERE ID = %d", $id) );
+		$wpdb->delete( "$wpdb->usermeta" , array( "user_id" => $id ) , array( '%d' ) );
+		$wpdb->delete( "$wpdb->users" , array( "ID" => $id ) , array( '%d' ) );
 	} else {
 		$level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
-		$wpdb->query("DELETE FROM $wpdb->usermeta WHERE user_id = $id AND meta_key = '{$level_key}'");
+		$wpdb->delete( "$wpdb->usermeta" , array( "user_id" => $id , "meta_key" => "'{$level_key}'" ) , array( '%d' , '%s' ) );
 	}
 
 	// allow for commit transaction
Index: wp-admin/includes/ms.php
===================================================================
--- wp-admin/includes/ms.php	(revision 19024)
+++ wp-admin/includes/ms.php	(working copy)
@@ -87,7 +87,7 @@
 		foreach ( (array) $drop_tables as $drop_table) {
 			$wpdb->query( "DROP TABLE IF EXISTS ". current( $drop_table ) ."" );
 		}
-		$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->blogs WHERE blog_id = %d", $blog_id ) );
+		$wpdb->delete( "$wpdb->blogs" , array( "blog_id" => $blog_id ) , array( '%d' ) );
 		$dir = apply_filters( 'wpmu_delete_blog_upload_dir', WP_CONTENT_DIR . "/blogs.dir/{$blog_id}/files/", $blog_id );
 		$dir = rtrim( $dir, DIRECTORY_SEPARATOR );
 		$top_dir = $dir;
@@ -120,7 +120,7 @@
 		}
 	}
 
-	$wpdb->query( "DELETE FROM {$wpdb->usermeta} WHERE meta_key = '{$blog_prefix}autosave_draft_ids'" );
+	$wpdb->delete( "{$wpdb->usermeta}" , array( "meta_key" => "'{$blog_prefix}autosave_draft_ids'" ) , array( '%s' ) );
 	$blogs = get_site_option( 'blog_list' );
 	if ( is_array( $blogs ) ) {
 		foreach ( $blogs as $n => $blog ) {
@@ -166,8 +166,8 @@
 		}
 	}
 
-	$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->users WHERE ID = %d", $id ) );
-	$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->usermeta WHERE user_id = %d", $id ) );
+	$wpdb->delete( "$wpdb->users" , array( "ID" => $id ) , array( '%d' ) );
+	$wpdb->delete( "$wpdb->usermeta" , array( "user_id" => $id ) , array( '%d' ) );
 
 	clean_user_cache( $id );
 
