From 446c704af524073f59c864fc5c1894f13cfcbd2c Mon Sep 17 00:00:00 2001 From: westi Date: Tue, 11 Sep 2007 20:05:52 +0000 Subject: [PATCH] Ensure (next|previous)_post_link always have some content even when the post title is blank. Fixes #1835, props johnbillion git-svn-id: http://svn.automattic.com/wordpress/trunk@6082 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/link-template.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 6182729ced..027edd0831 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -432,7 +432,12 @@ function previous_post_link($format='« %link', $link='%title', $in_same_ca if ( !$post ) return; - $title = apply_filters('the_title', $post->post_title, $post); + $title = $post->post_title; + + if ( empty($post->post_title) ) + $title = __('Previous Post'); + + $title = apply_filters('the_title', $title, $post); $string = ''; $link = str_replace('%title', $title, $link); $link = $pre . $string . $link . ''; @@ -448,7 +453,12 @@ function next_post_link($format='%link »', $link='%title', $in_same_cat = if ( !$post ) return; - $title = apply_filters('the_title', $post->post_title, $post); + $title = $post->post_title; + + if ( empty($post->post_title) ) + $title = __('Next Post'); + + $title = apply_filters('the_title', $title, $post); $string = ''; $link = str_replace('%title', $title, $link); $link = $string . $link . '';