Make WordPress Core

Ticket #18674: 18764.patch

File 18764.patch, 1.7 KB (added by Otto42, 13 years ago)
  • wp-includes/link-template.php

     
    14561456        else
    14571457                $post = get_adjacent_post($in_same_cat, $excluded_categories, $previous);
    14581458
    1459         if ( !$post )
    1460                 return;
     1459        if ( !$post ) {
     1460                $output = '';
     1461        } else {
    14611462
    1462         $title = $post->post_title;
     1463                $title = $post->post_title;
    14631464
    1464         if ( empty($post->post_title) )
    1465                 $title = $previous ? __('Previous Post') : __('Next Post');
     1465                if ( empty($post->post_title) )
     1466                        $title = $previous ? __('Previous Post') : __('Next Post');
    14661467
    1467         $title = apply_filters('the_title', $title, $post->ID);
    1468         $date = mysql2date(get_option('date_format'), $post->post_date);
    1469         $rel = $previous ? 'prev' : 'next';
     1468                $title = apply_filters('the_title', $title, $post->ID);
     1469                $date = mysql2date(get_option('date_format'), $post->post_date);
     1470                $rel = $previous ? 'prev' : 'next';
    14701471
    1471         $string = '<a href="'.get_permalink($post).'" rel="'.$rel.'">';
    1472         $link = str_replace('%title', $title, $link);
    1473         $link = str_replace('%date', $date, $link);
    1474         $link = $string . $link . '</a>';
     1472                $string = '<a href="'.get_permalink($post).'" rel="'.$rel.'">';
     1473                $inlink = str_replace('%title', $title, $link);
     1474                $inlink = str_replace('%date', $date, $inlink);
     1475                $inlink = $string . $inlink . '</a>';
    14751476
    1476         $format = str_replace('%link', $link, $format);
    1477 
     1477                $output = str_replace('%link', $inlink, $format);
     1478        }
     1479       
    14781480        $adjacent = $previous ? 'previous' : 'next';
    1479         echo apply_filters( "{$adjacent}_post_link", $format, $link );
     1481        echo apply_filters( "{$adjacent}_post_link", $output, $format, $link );
    14801482}
    14811483
    14821484/**