Make sure posts array is not empty before checking preview state. #2498
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@3602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b81908910f
commit
1acb5366d9
|
@ -654,7 +654,7 @@ class WP_Query {
|
|||
$this->posts = $wpdb->get_results($this->request);
|
||||
|
||||
// Check post status to determine if post should be displayed.
|
||||
if ($this->is_single) {
|
||||
if ( !empty($this->posts) && $this->is_single ) {
|
||||
$status = get_post_status($this->posts[0]);
|
||||
if ( ('publish' != $status) && ('static' != $status) ) {
|
||||
if ( ! (isset($user_ID) && ('' != intval($user_ID))) ) {
|
||||
|
|
Loading…
Reference in New Issue