From ed549303d7a4cecf0857e7539b58209facb91c29 Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 25 Jun 2007 17:48:35 +0000 Subject: [PATCH] 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 --- wp-admin/index.php | 2 +- wp-includes/comment-template.php | 2 +- wp-includes/feed-atom-comments.php | 1 - wp-includes/feed-rss2-comments.php | 1 - wp-includes/feed.php | 1 - wp-includes/post-template.php | 21 ++++++++++++--------- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/wp-admin/index.php b/wp-admin/index.php index 8c3577fdf..57c5cc4b3 100644 --- a/wp-admin/index.php +++ b/wp-admin/index.php @@ -49,7 +49,7 @@ if ( $comments || $numcomments ) : ' . sprintf(__('%1$s on %2$s'), get_comment_author_link(), '' . apply_filters('the_title', get_the_title($comment->comment_post_ID)) . ''); + echo '
  • ' . sprintf(__('%1$s on %2$s'), get_comment_author_link(), '' . get_the_title($comment->comment_post_ID) . ''); edit_comment_link(__("Edit"), ' (', ')'); echo '
  • '; } diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 91417b1b1..9baea1ae5 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -364,7 +364,7 @@ function comments_popup_link($zero='No Comments', $one='1 Comment', $more='% Com if (!empty($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 ) .'">'; comments_number($zero, $one, $more, $number); echo ''; diff --git a/wp-includes/feed-atom-comments.php b/wp-includes/feed-atom-comments.php index 0cde6e774..a05f17dfc 100644 --- a/wp-includes/feed-atom-comments.php +++ b/wp-includes/feed-atom-comments.php @@ -33,7 +33,6 @@ if ( have_comments() ) : while ( have_comments() ) : the_comment(); <?php if ( !is_singular() ) { $title = get_the_title($comment_post->ID); - $title = apply_filters('the_title', $title); $title = apply_filters('the_title_rss', $title); printf(__('Comment on %1$s by %2$s'), $title, get_comment_author_rss()); } else { diff --git a/wp-includes/feed-rss2-comments.php b/wp-includes/feed-rss2-comments.php index 4865dfbe0..33e44c1d5 100644 --- a/wp-includes/feed-rss2-comments.php +++ b/wp-includes/feed-rss2-comments.php @@ -29,7 +29,6 @@ if ( have_comments() ) : while ( have_comments() ) : the_comment(); <title><?php if ( !is_singular() ) { $title = get_the_title($comment_post->ID); - $title = apply_filters('the_title', $title); $title = apply_filters('the_title_rss', $title); printf(__('Comment on %1$s by %2$s'), $title, get_comment_author_rss()); } else { diff --git a/wp-includes/feed.php b/wp-includes/feed.php index 5da62eef1..3f635e67b 100644 --- a/wp-includes/feed.php +++ b/wp-includes/feed.php @@ -22,7 +22,6 @@ function wp_title_rss($sep = '»') { function get_the_title_rss() { $title = get_the_title(); - $title = apply_filters('the_title', $title); $title = apply_filters('the_title_rss', $title); return $title; } diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 2e1d1efd4..6c8d37b94 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -18,17 +18,20 @@ function get_the_ID() { function the_title($before = '', $after = '', $echo = true) { $title = get_the_title(); - if ( strlen($title) > 0 ) { - $title = apply_filters('the_title', $before . $title . $after, $before, $after); - if ( $echo ) - echo $title; - else - return $title; - } + + if ( strlen($title) <= 0 ) + return; + + $title = $before . $title . $after; + + if ( $echo ) + echo $title; + else + return $title; } -function get_the_title($id = 0) { +function get_the_title( $id = 0 ) { $post = &get_post($id); $title = $post->post_title; @@ -37,7 +40,7 @@ function get_the_title($id = 0) { else if ( 'private' == $post->post_status ) $title = sprintf(__('Private: %s'), $title); - return $title; + return apply_filters( 'the_title', $title ); } function the_guid( $id = 0 ) {