WordPress.org

Make WordPress Core

Ticket #14296: 14296.diff

File 14296.diff, 693 bytes (added by zeo, 5 years ago)
  • wp-includes/link-template.php

     
    13421342 * @param bool $previous Optional, default is true. Whether display link to previous post. 
    13431343 */ 
    13441344function adjacent_post_link($format, $link, $in_same_cat = false, $excluded_categories = '', $previous = true) { 
    1345         if ( $previous && is_attachment() ) 
     1345        if ( $previous && is_attachment() && !empty($GLOBALS['post']->post_parent) ) 
    13461346                $post = & get_post($GLOBALS['post']->post_parent); 
    13471347        else 
    13481348                $post = get_adjacent_post($in_same_cat, $excluded_categories, $previous);