From 9fd4eb9adfd2d18a94049392e4fc6e8eb5d78d65 Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 17 Apr 2005 17:09:19 +0000 Subject: [PATCH] Filter the title in next_post() and previous_post(). Mark next_post() and previous_post() as deprecated. Update the default theme to use next_post_link() and previous_post_link(). http://mosquito.wordpress.org/view.php?id=1241 Hat tip: wyrfel git-svn-id: http://svn.automattic.com/wordpress/trunk@2538 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/default/single.php | 4 ++-- wp-includes/template-functions-links.php | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/wp-content/themes/default/single.php b/wp-content/themes/default/single.php index c2c43a19d..476c946fb 100644 --- a/wp-content/themes/default/single.php +++ b/wp-content/themes/default/single.php @@ -5,8 +5,8 @@
diff --git a/wp-includes/template-functions-links.php b/wp-includes/template-functions-links.php index d25a064c8..ea2ef2ce2 100644 --- a/wp-includes/template-functions-links.php +++ b/wp-includes/template-functions-links.php @@ -293,6 +293,7 @@ function next_post_link($format='%link »', $link='%title', $in_same_cat = echo $format; } +// Deprecated. Use previous_post_link(). function previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') { global $id, $post, $wpdb; global $posts, $posts_per_page, $s; @@ -321,7 +322,7 @@ function previous_post($format='%', $previous='previous post: ', $title='yes', $ if ($lastpost) { $string = ''.$previous; if ($title == 'yes') { - $string .= wptexturize($lastpost->post_title); + $string .= apply_filters('the_title', $lastpost->post_title, $lastpost); } $string .= ''; $format = str_replace('%', $string, $format); @@ -330,6 +331,7 @@ function previous_post($format='%', $previous='previous post: ', $title='yes', $ } } +// Deprecated. Use next_post_link(). function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') { global $posts_per_page, $post, $wpdb; if(1 == $posts_per_page || is_single()) { @@ -359,7 +361,7 @@ function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat= if ($nextpost) { $string = ''.$next; if ($title=='yes') { - $string .= wptexturize($nextpost->post_title); + $string .= apply_filters('the_title', $nextpost->post_title, $nextpost); } $string .= ''; $format = str_replace('%', $string, $format);