mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-05 13:14:29 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user