From 24a1c0ab4aa321e08cdf4f4db682dcd432726256 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 20 Dec 2011 20:46:06 +0000 Subject: [PATCH] Fix notice when viewing a post preview logged out. props SergeyBiryukov, fixes #19366. git-svn-id: https://develop.svn.wordpress.org/trunk@19604 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index eead30b2c4..80cbb3adf8 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -2683,7 +2683,7 @@ class WP_Query { } } - if ( $this->is_preview && current_user_can( $edit_cap, $this->posts[0]->ID ) ) + if ( $this->is_preview && $this->posts && current_user_can( $edit_cap, $this->posts[0]->ID ) ) $this->posts[0] = apply_filters_ref_array('the_preview', array( $this->posts[0], &$this )); }