diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php
index 4a2e3fe35..13210548f 100644
--- a/wp-includes/general-template.php
+++ b/wp-includes/general-template.php
@@ -1444,29 +1444,34 @@ function feed_links_extra( $args ) {
if ( is_single() || is_page() ) {
$post = &get_post( $id = 0 );
- if ( comments_open() || pings_open() || $post->comment_count > 0 )
- echo '\n";
- }
- elseif ( is_category() ) {
+ if ( comments_open() || pings_open() || $post->comment_count > 0 ) {
+ $title = attribute_escape(sprintf( $args['singletitle'], get_bloginfo('name'), $args['seperator'], wp_specialchars( get_the_title() ) ));
+ $href = get_post_comments_feed_link( $post->ID );
+ }
+ } elseif ( is_category() ) {
$cat_id = intval( get_query_var('cat') );
- echo '\n";
- }
- elseif ( is_tag() ) {
+ $title = attribute_escape(sprintf( $args['cattitle'], get_bloginfo('name'), $args['seperator'], get_cat_name( $cat_id ) ));
+ $href = get_category_feed_link( $cat_id );
+ } elseif ( is_tag() ) {
$tag_id = intval( get_query_var('tag_id') );
$tag = get_tag( $tag_id );
- echo '\n";
- }
- elseif ( is_author() ) {
+ $title = attribute_escape(sprintf( $args['tagtitle'], get_bloginfo('name'), $args['seperator'], $tag->name ));
+ $href = get_tag_feed_link( $tag_id );
+ } elseif ( is_author() ) {
$author_id = intval( get_query_var('author') );
- echo '\n";
+
+ $title = attribute_escape(sprintf( $args['authortitle'], get_bloginfo('name'), $args['seperator'], get_author_name( $author_id ) ));
+ $href = get_author_feed_link( $author_id );
+ } elseif ( is_search() ) {
+ $title = attribute_escape(sprintf( $args['searchtitle'], get_bloginfo('name'), $args['seperator'], get_search_query() ));
+ $href = get_search_feed_link();
}
- elseif ( is_search() ) {
- echo '\n";
- }
+ if ( isset($title) && isset($href) )
+ echo '' . "\n";
}
/**