Index: wp-includes/comment.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- wp-includes/comment.php	(revision 41327)
+++ wp-includes/comment.php	(revision )
@@ -2446,23 +2446,27 @@
 function do_all_pings() {
 	global $wpdb;
 
+	$post_types = get_post_types( array( 'publicly_queryable' => true ) );
+
 	// Do pingbacks
-	while ($ping = $wpdb->get_row("SELECT ID, post_content, meta_id FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_pingme' LIMIT 1")) {
-		delete_metadata_by_mid( 'post', $ping->meta_id );
+	$pings = get_posts( array( 'post_type' => $post_types, 'suppress_filters' => false, 'nopaging' => true, 'meta_value' => '_pingme' ) );
+	foreach ( $pings as $ping ) {
+		delete_post_meta( $ping->ID, '_pingme' );
 		pingback( $ping->post_content, $ping->ID );
 	}
 
 	// Do Enclosures
-	while ($enclosure = $wpdb->get_row("SELECT ID, post_content, meta_id FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_encloseme' LIMIT 1")) {
-		delete_metadata_by_mid( 'post', $enclosure->meta_id );
+	$enclosures = get_posts( array( 'post_type' => $post_types, 'suppress_filters' => false, 'nopaging' => true, 'meta_value' => '_encloseme' ) );
+	foreach ( $enclosures as $enclosure ) {
+		delete_post_meta( $enclosure->ID, '_encloseme' );
 		do_enclose( $enclosure->post_content, $enclosure->ID );
 	}
 
 	// Do Trackbacks
-	$trackbacks = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE to_ping <> '' AND post_status = 'publish'");
-	if ( is_array($trackbacks) )
-		foreach ( $trackbacks as $trackback )
-			do_trackbacks($trackback);
+	$trackbacks = get_posts( array( 'post_type' => $post_types, 'suppress_filters' => false, 'nopaging' => true, 'to_ping' => true, 'fields' => 'ids' ) );
+	foreach ( $trackbacks as $trackback ) {
+		do_trackbacks( $trackback );
+	}
 
 	//Do Update Services/Generic Pings
 	generic_ping();
@@ -3013,7 +3017,7 @@
 		 * @param int $comment_post_ID Post ID.
 		 */
 		do_action( 'comment_on_draft', $comment_post_ID );
-		
+
 		if ( current_user_can( 'read_post', $comment_post_ID ) ) {
 			return new WP_Error( 'comment_on_draft', __( 'Sorry, comments are not allowed for this item.' ), 403 );
 		} else {
