From 32d46956022ae340b0bc487fba59c8b5ac82df11 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Thu, 24 Dec 2009 09:30:12 +0000 Subject: [PATCH] Make sure the post global is actually an object before we treat it like one. git-svn-id: https://develop.svn.wordpress.org/trunk@12532 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/link-template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 109d4d99b4..d0c6a4df60 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -987,7 +987,7 @@ function get_adjacent_post($in_same_cat = false, $excluded_categories = '', $pre * @return string */ function get_adjacent_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '', $previous = true) { - if ( $previous && is_attachment() ) + if ( $previous && is_attachment() && is_object( $GLOBALS['post'] ) ) $post = & get_post($GLOBALS['post']->post_parent); else $post = get_adjacent_post($in_same_cat,$excluded_categories,$previous);