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

git-svn-id: https://develop.svn.wordpress.org/trunk@1892 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2004-11-27 04:47:54 +00:00
parent 226f415935
commit 89fb8beb57
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;
}