Posts in the Trash should not drag attachment pages down with them.
Props ericlewis. Fixes #14639. git-svn-id: https://develop.svn.wordpress.org/trunk@28791 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e447c8f823
commit
304f4f5ba9
@ -836,8 +836,15 @@ function get_post_status($ID = '') {
|
||||
return 'publish';
|
||||
|
||||
// Inherit status from the parent
|
||||
if ( $post->post_parent && ( $post->ID != $post->post_parent ) )
|
||||
return get_post_status($post->post_parent);
|
||||
if ( $post->post_parent && ( $post->ID != $post->post_parent ) ) {
|
||||
$parent_post_status = get_post_status( $post->post_parent );
|
||||
if ( 'trash' == $parent_post_status ) {
|
||||
return get_post_meta( $post->post_parent, '_wp_trash_meta_status', true );
|
||||
} else {
|
||||
return $parent_post_status;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $post->post_status;
|
||||
|
Loading…
Reference in New Issue
Block a user