From 5b05536235821b12619cf8e3aab19f3c3947edf2 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sun, 28 Feb 2010 00:00:43 +0000 Subject: [PATCH] Allow get_(previous|adjacent|next)_post() to be used on attachment and !single templates. props jobjorn, fixes #10867 git-svn-id: https://develop.svn.wordpress.org/trunk@13475 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 050f34dcc1..6d63a3ca34 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -932,7 +932,7 @@ function get_next_post($in_same_cat = false, $excluded_categories = '') { function get_adjacent_post($in_same_cat = false, $excluded_categories = '', $previous = true) { global $post, $wpdb; - if ( empty($post) || !is_single() || is_attachment() ) + if ( empty( $post ) ) return null; $current_post_date = $post->post_date;