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
This commit is contained in:
Mark Jaquith 2009-12-24 09:30:12 +00:00
parent b6669a3c9d
commit 32d4695602
1 changed files with 1 additions and 1 deletions

View File

@ -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);