Move the_title filter to get_the_title. Props jhodgdon. fixes #4477

git-svn-id: http://svn.automattic.com/wordpress/trunk@5752 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-06-25 17:48:35 +00:00
parent 1111b0c5fe
commit ed549303d7
6 changed files with 14 additions and 14 deletions

View File

@ -49,7 +49,7 @@ if ( $comments || $numcomments ) :
<?php <?php
if ( $comments ) { if ( $comments ) {
foreach ($comments as $comment) { foreach ($comments as $comment) {
echo '<li>' . sprintf(__('%1$s on %2$s'), get_comment_author_link(), '<a href="'. get_permalink($comment->comment_post_ID) . '#comment-' . $comment->comment_ID . '">' . apply_filters('the_title', get_the_title($comment->comment_post_ID)) . '</a>'); echo '<li>' . sprintf(__('%1$s on %2$s'), get_comment_author_link(), '<a href="'. get_permalink($comment->comment_post_ID) . '#comment-' . $comment->comment_ID . '">' . get_the_title($comment->comment_post_ID) . '</a>');
edit_comment_link(__("Edit"), ' <small>(', ')</small>'); edit_comment_link(__("Edit"), ' <small>(', ')</small>');
echo '</li>'; echo '</li>';
} }

View File

@ -364,7 +364,7 @@ function comments_popup_link($zero='No Comments', $one='1 Comment', $more='% Com
if (!empty($CSSclass)) { if (!empty($CSSclass)) {
echo ' class="'.$CSSclass.'"'; echo ' class="'.$CSSclass.'"';
} }
$title = attribute_escape(apply_filters('the_title', get_the_title())); $title = attribute_escape(get_the_title());
echo ' title="' . sprintf( __('Comment on %s'), $title ) .'">'; echo ' title="' . sprintf( __('Comment on %s'), $title ) .'">';
comments_number($zero, $one, $more, $number); comments_number($zero, $one, $more, $number);
echo '</a>'; echo '</a>';

View File

@ -33,7 +33,6 @@ if ( have_comments() ) : while ( have_comments() ) : the_comment();
<title><?php <title><?php
if ( !is_singular() ) { if ( !is_singular() ) {
$title = get_the_title($comment_post->ID); $title = get_the_title($comment_post->ID);
$title = apply_filters('the_title', $title);
$title = apply_filters('the_title_rss', $title); $title = apply_filters('the_title_rss', $title);
printf(__('Comment on %1$s by %2$s'), $title, get_comment_author_rss()); printf(__('Comment on %1$s by %2$s'), $title, get_comment_author_rss());
} else { } else {

View File

@ -29,7 +29,6 @@ if ( have_comments() ) : while ( have_comments() ) : the_comment();
<title><?php <title><?php
if ( !is_singular() ) { if ( !is_singular() ) {
$title = get_the_title($comment_post->ID); $title = get_the_title($comment_post->ID);
$title = apply_filters('the_title', $title);
$title = apply_filters('the_title_rss', $title); $title = apply_filters('the_title_rss', $title);
printf(__('Comment on %1$s by %2$s'), $title, get_comment_author_rss()); printf(__('Comment on %1$s by %2$s'), $title, get_comment_author_rss());
} else { } else {

View File

@ -22,7 +22,6 @@ function wp_title_rss($sep = '&#187;') {
function get_the_title_rss() { function get_the_title_rss() {
$title = get_the_title(); $title = get_the_title();
$title = apply_filters('the_title', $title);
$title = apply_filters('the_title_rss', $title); $title = apply_filters('the_title_rss', $title);
return $title; return $title;
} }

View File

@ -18,17 +18,20 @@ function get_the_ID() {
function the_title($before = '', $after = '', $echo = true) { function the_title($before = '', $after = '', $echo = true) {
$title = get_the_title(); $title = get_the_title();
if ( strlen($title) > 0 ) {
$title = apply_filters('the_title', $before . $title . $after, $before, $after); if ( strlen($title) <= 0 )
return;
$title = $before . $title . $after;
if ( $echo ) if ( $echo )
echo $title; echo $title;
else else
return $title; return $title;
}
} }
function get_the_title($id = 0) { function get_the_title( $id = 0 ) {
$post = &get_post($id); $post = &get_post($id);
$title = $post->post_title; $title = $post->post_title;
@ -37,7 +40,7 @@ function get_the_title($id = 0) {
else if ( 'private' == $post->post_status ) else if ( 'private' == $post->post_status )
$title = sprintf(__('Private: %s'), $title); $title = sprintf(__('Private: %s'), $title);
return $title; return apply_filters( 'the_title', $title );
} }
function the_guid( $id = 0 ) { function the_guid( $id = 0 ) {