mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +00:00
Fix notice in get_boundary_post_rel_link when there is no post to link. Fixes #11490 props ShaneF.
git-svn-id: http://svn.automattic.com/wordpress/trunk@12457 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4bb7072c51
commit
16d60d90a9
@ -1113,12 +1113,13 @@ function get_boundary_post($in_same_cat = false, $excluded_categories = '', $sta
|
||||
*/
|
||||
function get_boundary_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '', $start = true) {
|
||||
$posts = get_boundary_post($in_same_cat,$excluded_categories,$start);
|
||||
// If there is no post stop.
|
||||
if ( empty($posts) )
|
||||
return;
|
||||
|
||||
// Even though we limited get_posts to return only 1 item it still returns an array of objects.
|
||||
$post = $posts[0];
|
||||
|
||||
if ( empty($post) )
|
||||
return;
|
||||
|
||||
if ( empty($post->post_title) )
|
||||
$post->post_title = $start ? __('First Post') : __('Last Post');
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user