From 7d37926ebc4cc821e05a51b7dca07bf6357d85cc Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 1 Apr 2009 16:10:14 +0000 Subject: [PATCH] Move deleted_post back. Props Denis-de-Bernardy . see #9422 git-svn-id: http://svn.automattic.com/wordpress/trunk@10858 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/schema.php | 4 ++-- wp-includes/post.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/schema.php b/wp-admin/includes/schema.php index 664a217e79..bb1c33d861 100644 --- a/wp-admin/includes/schema.php +++ b/wp-admin/includes/schema.php @@ -68,7 +68,7 @@ CREATE TABLE $wpdb->comments ( comment_approved varchar(20) NOT NULL default '1', comment_agent varchar(255) NOT NULL default '', comment_type varchar(20) NOT NULL default '', - comment_parent bigint(20) NOT NULL default '0', + comment_parent bigint(20) unsigned NOT NULL default '0', user_id bigint(20) unsigned NOT NULL default '0', PRIMARY KEY (comment_ID), KEY comment_approved (comment_approved), @@ -85,7 +85,7 @@ CREATE TABLE $wpdb->links ( link_category bigint(20) NOT NULL default '0', link_description varchar(255) NOT NULL default '', link_visible varchar(20) NOT NULL default 'Y', - link_owner bigint(20) NOT NULL default '1', + link_owner bigint(20) unsigned NOT NULL default '1', link_rating int(11) NOT NULL default '0', link_updated datetime NOT NULL default '0000-00-00 00:00:00', link_rel varchar(255) NOT NULL default '', diff --git a/wp-includes/post.php b/wp-includes/post.php index 8cc0d7b341..7d5a1c6b7a 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -1159,8 +1159,6 @@ function wp_delete_post($postid = 0) { foreach ( $revision_ids as $revision_id ) wp_delete_post_revision( $revision_id ); - do_action('deleted_post', $postid); - // Point all attachments to this post up one level $wpdb->update( $wpdb->posts, $parent_data, $parent_where + array( 'post_type' => 'attachment' ) ); @@ -1181,6 +1179,8 @@ function wp_delete_post($postid = 0) { clean_post_cache($postid); } + do_action('deleted_post', $postid); + return $post; }