diff --git a/wp-includes/query.php b/wp-includes/query.php index 354615ff2b..e81951a740 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -2686,6 +2686,8 @@ class WP_Query { $read_private_cap = 'read_private_' . $post_type_cap . 's'; } + $user_id = get_current_user_id(); + if ( ! empty( $q['post_status'] ) ) { $statuswheres = array(); $q_status = $q['post_status']; @@ -2713,8 +2715,6 @@ class WP_Query { unset($p_status); } - $user_id = get_current_user_id(); - if ( !empty($e_status) ) { $statuswheres[] = "(" . join( ' AND ', $e_status ) . ")"; }