WordPress.org

Make WordPress Core

Ticket #11490: 11490.diff

File 11490.diff, 971 bytes (added by ShaneF, 5 years ago)
  • link-template.php

     
    11131113 */ 
    11141114function get_boundary_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '', $start = true) { 
    11151115        $posts = get_boundary_post($in_same_cat,$excluded_categories,$start); 
     1116        // If there is no post exist, stop. 
     1117        if ( empty($posts) ) 
     1118                         return; 
     1119         
    11161120        // Even though we limited get_posts to return only 1 item it still returns an array of objects. 
    11171121        $post = $posts[0]; 
    11181122 
    1119         if ( empty($post) ) 
    1120                          return; 
     1123        if ( empty($post->post_title) ) 
     1124                $post->post_title = $start ? __('First Post') : __('Last Post'); 
    11211125 
    1122                 if ( empty($post->post_title) ) 
    1123                                 $post->post_title = $start ? __('First Post') : __('Last Post'); 
    1124  
    11251126        $date = mysql2date(get_option('date_format'), $post->post_date); 
    11261127 
    11271128        $title = str_replace('%title', $post->post_title, $title);