Fix returning to the previous post_status when restoring posts from the trash, see #4529
git-svn-id: https://develop.svn.wordpress.org/trunk@11880 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
6db1862bd7
commit
69cac32a8f
@ -1257,10 +1257,14 @@ function wp_untrash_post($post_id = 0) {
|
||||
|
||||
do_action('untrash_post', $post_id);
|
||||
|
||||
$post['post_status'] = ('attachment' == $post['post_type'] ) ? 'inherit' : 'draft';
|
||||
$post_status = get_post_meta($post_id, '_wp_trash_meta_status', true);
|
||||
if ( empty($post_status) )
|
||||
$post_status = ('attachment' == $post['post_type'] ) ? 'inherit' : 'draft';
|
||||
|
||||
delete_post_meta($post_id,'_wp_trash_meta_status');
|
||||
delete_post_meta($post_id,'_wp_trash_meta_time');
|
||||
$post['post_status'] = $post_status;
|
||||
|
||||
delete_post_meta($post_id, '_wp_trash_meta_status');
|
||||
delete_post_meta($post_id, '_wp_trash_meta_time');
|
||||
|
||||
wp_insert_post($post);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user