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:
parent
da5a212bff
commit
5b05536235
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue