From 2423095bc16f1adbf721d1be22fa7d130c0ff9a8 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 20 Dec 2010 11:41:08 +0000 Subject: [PATCH] Relocate isset check. Props TobiasBg, SergeyBiryukov. fixes #15041 git-svn-id: https://develop.svn.wordpress.org/trunk@17076 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 9edb1bb13e..7893eb006e 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);