From 894d5682de4fdbf8b8a29ff8ec047ddb31c9b7ee Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 22 Aug 2008 02:21:37 +0000 Subject: [PATCH] Respect argument in get_author_feed_link(). Props Latz. fixes #7564 git-svn-id: http://svn.automattic.com/wordpress/trunk@8706 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/link-template.php | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 44d2007e85..a5c9b33fc5 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -319,6 +319,19 @@ function post_comments_feed_link( $link_text = '', $post_id = '', $feed = '' ) { echo "$link_text"; } +/** Get the feed link for a given author + * + * Returns a link to the feed for all posts by a given author. A specific feed can be requested + * or left blank to get the default feed. + * + * @package WordPress + * @subpackage Feed + * @since 2.5 + * + * @param int $author_id ID of an author + * @param string $feed Feed type + * @return string Link to the feed for the author specified by $author_id +*/ function get_author_feed_link( $author_id, $feed = '' ) { $author_id = (int) $author_id; $permalink_structure = get_option('permalink_structure'); @@ -327,20 +340,25 @@ function get_author_feed_link( $author_id, $feed = '' ) { $feed = get_default_feed(); if ( '' == $permalink_structure ) { - $link = get_option('home') . '?feed=rss2&author=' . $author_id; + $link = get_option('home') . "?feed=$feed&author=" . $author_id; } else { $link = get_author_posts_url($author_id); - $link = trailingslashit($link) . user_trailingslashit('feed', 'feed'); + if ( $feed == get_default_feed() ) + $feed_link = 'feed'; + else + $feed_link = "feed/$feed"; + + $link = trailingslashit($link) . user_trailingslashit($feed_link, 'feed'); } - $link = apply_filters('author_feed_link', $link); + $link = apply_filters('author_feed_link', $link, $feed); return $link; } -/** get_category_feed_link() - Get the feed link for a given category +/** Get the feed link for a given category * - * Returns a link to the feed for all post in a given category. A specific feed can be requested + * Returns a link to the feed for all posts in a given category. A specific feed can be requested * or left blank to get the default feed. * * @package WordPress