Posts, Post Types: Revert [47179] pending test failures investigation.

See #48653.
Built from https://develop.svn.wordpress.org/trunk@47180


git-svn-id: http://core.svn.wordpress.org/trunk@46980 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2020-02-04 23:02:09 +00:00
parent 73a088f5b6
commit da6f24fba9
2 changed files with 20 additions and 26 deletions

View File

@ -3066,18 +3066,16 @@ class WP_Query {
// Check post status to determine if post should be displayed.
if ( ! empty( $this->posts ) && ( $this->is_single || $this->is_page ) ) {
$status = get_post_status( $this->posts[0] );
if ( 'attachment' === $this->posts[0]->post_type && 0 === (int) $this->posts[0]->post_parent ) {
$this->is_page = false;
$this->is_single = true;
$this->is_attachment = true;
}
// If the post_status was specifically requested, let it pass through.
if ( ! in_array( $status, $q_status ) ) {
$post_status_obj = get_post_status_object( $status );
if ( $post_status_obj && ! $post_status_obj->public ) {
// If the post_status was specifically requested, let it pass through.
if ( ! $post_status_obj->public && ! in_array( $status, $q_status ) ) {
if ( ! is_user_logged_in() ) {
// User must be logged in to view unpublished posts.
$this->posts = array();
@ -3100,10 +3098,6 @@ class WP_Query {
$this->posts = array();
}
}
} else {
// Post status is not registered, assume it's not public.
$this->posts = array();
}
}
if ( $this->is_preview && $this->posts && current_user_can( $edit_cap, $this->posts[0]->ID ) ) {

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.4-alpha-47179';
$wp_version = '5.4-alpha-47180';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.