From 9e80bec002b9c3ccf77fb3b5d62185d811f00982 Mon Sep 17 00:00:00 2001 From: markjaquith Date: Thu, 6 Oct 2011 21:09:37 +0000 Subject: [PATCH] Always pass the post ID as the second argument to the the_title filter. props GaryJ. fixes #16688 git-svn-id: http://svn.automattic.com/wordpress/trunk@18907 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment.php | 2 +- wp-includes/deprecated.php | 4 ++-- wp-includes/general-template.php | 7 +++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/wp-includes/comment.php b/wp-includes/comment.php index 96353e0024..84076d715a 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -1711,7 +1711,7 @@ function do_trackbacks($post_id) { $excerpt = str_replace(']]>', ']]>', $excerpt); $excerpt = wp_html_excerpt($excerpt, 252) . '...'; - $post_title = apply_filters('the_title', $post->post_title); + $post_title = apply_filters('the_title', $post->post_title, $post->ID); $post_title = strip_tags($post_title); if ( $to_ping ) { diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php index 36d0200609..aafe8735d2 100644 --- a/wp-includes/deprecated.php +++ b/wp-includes/deprecated.php @@ -149,7 +149,7 @@ function previous_post($format='%', $previous='previous post: ', $title='yes', $ $string = ''.$previous; if ( 'yes' == $title ) - $string .= apply_filters('the_title', $post->post_title, $post); + $string .= apply_filters('the_title', $post->post_title, $post->ID); $string .= ''; $format = str_replace('%', $string, $format); echo $format; @@ -185,7 +185,7 @@ function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat= $string = ''.$next; if ( 'yes' == $title ) - $string .= apply_filters('the_title', $post->post_title, $nextpost); + $string .= apply_filters('the_title', $post->post_title, $post->ID); $string .= ''; $format = str_replace('%', $string, $format); echo $format; diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 347061acbe..d1f9308d3d 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -1012,10 +1012,9 @@ function wp_get_archives($args = '') { if ( $arcresults ) { foreach ( (array) $arcresults as $arcresult ) { if ( $arcresult->post_date != '0000-00-00 00:00:00' ) { - $url = get_permalink($arcresult); - $arc_title = $arcresult->post_title; - if ( $arc_title ) - $text = strip_tags(apply_filters('the_title', $arc_title)); + $url = get_permalink( $arcresult ); + if ( $arcresult->post_title ) + $text = strip_tags( apply_filters( 'the_title', $arcresult->post_title, $arcresult->ID ) ); else $text = $arcresult->ID; $output .= get_archives_link($url, $text, $format, $before, $after);