From 39bf85133f8e2d9a7264110d15c222bc747c6932 Mon Sep 17 00:00:00 2001 From: rboren Date: Sat, 27 Nov 2004 04:47:54 +0000 Subject: [PATCH] Perform empty() check on $doing_rss to avoid warning. git-svn-id: http://svn.automattic.com/wordpress/trunk@1892 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-feed.php | 2 +- wp-includes/functions-post.php | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/wp-feed.php b/wp-feed.php index 4b662f8abd..8f7dfba258 100644 --- a/wp-feed.php +++ b/wp-feed.php @@ -1,6 +1,6 @@ post2cat WHERE post_id = $postid"; - $wpdb->query($sql); - - $sql = "DELETE FROM $wpdb->posts WHERE ID = $postid"; - - $wpdb->query($sql); - $result = $wpdb->rows_affected; + $result = $wpdb->query("DELETE FROM $wpdb->posts WHERE ID = $postid"); + + if (!$result) + return $result; + + $wpdb->query("DELETE FROM $wpdb->comments WHERE comment_post_ID = $postid"); + + $wpdb->query("DELETE FROM $wpdb->post2cat WHERE post_id = $postid"); + + $wpdb->query("DELETE FROM $wpdb->postmeta WHERE post_id = $postid"); return $result; }