Perform empty() check on $doing_rss to avoid warning.

git-svn-id: http://svn.automattic.com/wordpress/trunk@1892 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
rboren 2004-11-27 04:47:54 +00:00
parent e9cd4f12cc
commit 39bf85133f
2 changed files with 11 additions and 9 deletions

View File

@ -1,6 +1,6 @@
<?php
if (! $doing_rss) {
if (empty($doing_rss)) {
$doing_rss = 1;
require('wp-blog-header.php');
}

View File

@ -204,15 +204,17 @@ function wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array(
function wp_delete_post($postid = 0) {
global $wpdb;
$sql = "DELETE FROM $wpdb->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;
}