WordPress.org

Make WordPress Core

Changeset 8706


Ignore:
Timestamp:
08/22/2008 02:21:37 AM (10 years ago)
Author:
ryan
Message:

Respect argument in get_author_feed_link(). Props Latz. fixes #7564

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/link-template.php

    r8672 r8706  
    320320}
    321321
     322/** Get the feed link for a given author
     323 *
     324 * Returns a link to the feed for all posts by a given author.  A specific feed can be requested
     325 * or left blank to get the default feed.
     326 *
     327 * @package WordPress
     328 * @subpackage Feed
     329 * @since 2.5
     330 *
     331 * @param int $author_id ID of an author
     332 * @param string $feed Feed type
     333 * @return string Link to the feed for the author specified by $author_id
     334*/
    322335function get_author_feed_link( $author_id, $feed = '' ) {
    323336    $author_id = (int) $author_id;
     
    328341
    329342    if ( '' == $permalink_structure ) {
    330         $link = get_option('home') . '?feed=rss2&author=' . $author_id;
     343        $link = get_option('home') . "?feed=$feed&author=" . $author_id;
    331344    } else {
    332345        $link = get_author_posts_url($author_id);
    333         $link = trailingslashit($link) . user_trailingslashit('feed', 'feed');
    334     }
    335 
    336     $link = apply_filters('author_feed_link', $link);
     346        if ( $feed == get_default_feed() )
     347            $feed_link = 'feed';
     348        else
     349            $feed_link = "feed/$feed";
     350
     351        $link = trailingslashit($link) . user_trailingslashit($feed_link, 'feed');
     352    }
     353
     354    $link = apply_filters('author_feed_link', $link, $feed);
    337355
    338356    return $link;
    339357}
    340358
    341 /** get_category_feed_link() - Get the feed link for a given category
    342  *
    343  * Returns a link to the feed for all post in a given category.  A specific feed can be requested
     359/** Get the feed link for a given category
     360 *
     361 * Returns a link to the feed for all posts in a given category.  A specific feed can be requested
    344362 * or left blank to get the default feed.
    345363 *
Note: See TracChangeset for help on using the changeset viewer.