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
This commit is contained in:
Andrew Nacin 2010-02-28 00:00:43 +00:00
parent da5a212bff
commit 5b05536235
1 changed files with 1 additions and 1 deletions

View File

@ -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) { function get_adjacent_post($in_same_cat = false, $excluded_categories = '', $previous = true) {
global $post, $wpdb; global $post, $wpdb;
if ( empty($post) || !is_single() || is_attachment() ) if ( empty( $post ) )
return null; return null;
$current_post_date = $post->post_date; $current_post_date = $post->post_date;