WordPress.org

Make WordPress Core

Changeset 12457


Ignore:
Timestamp:
12/19/09 09:21:00 (4 years ago)
Author:
westi
Message:

Fix notice in get_boundary_post_rel_link when there is no post to link. Fixes #11490 props ShaneF.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/link-template.php

    r12395 r12457  
    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 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; 
    1121  
    1122         if ( empty($post->post_title) ) 
    1123                 $post->post_title = $start ? __('First Post') : __('Last Post'); 
     1123    if ( empty($post->post_title) ) 
     1124        $post->post_title = $start ? __('First Post') : __('Last Post'); 
    11241125 
    11251126    $date = mysql2date(get_option('date_format'), $post->post_date); 
Note: See TracChangeset for help on using the changeset viewer.