From cb883521442f11776ec2fb21978473c1837e3905 Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 20 Dec 2010 11:41:08 +0000 Subject: [PATCH] Relocate isset check. Props TobiasBg, SergeyBiryukov. fixes #15041 git-svn-id: http://svn.automattic.com/wordpress/trunk@17076 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/link-template.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 9edb1bb13..7893eb006 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -185,11 +185,11 @@ function get_post_permalink( $id = 0, $leavename = false, $sample = false ) { $slug = $post->post_name; - $draft_or_pending = in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft' ) ); + $draft_or_pending = isset($post->post_status) && in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft' ) ); $post_type = get_post_type_object($post->post_type); - if ( !empty($post_link) && ( ( isset($post->post_status) && !$draft_or_pending ) || $sample ) ) { + if ( !empty($post_link) && ( !$draft_or_pending || $sample ) ) { if ( ! $leavename ) { if ( $post_type->hierarchical ) $slug = get_page_uri($id);