Advertisements

get_author_feed_link

Definition:
function get_author_feed_link( $author_id, $feed = '' ) {}

Retrieve 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.

Parameters

  • int $author_id: ID of an author.
  • string $feed: Optional. Feed type.

Return values

returns:Link to the feed for the author specified by $author_id.

Defined filters

  • author_feed_link
    apply_filters('author_feed_link', $link, $feed)

Source code

function get_author_feed_link( $author_id, $feed = '' ) {

	$author_id = (int) $author_id;

	$permalink_structure = get_option('permalink_structure');



	if ( empty($feed) )

		$feed = get_default_feed();



	if ( '' == $permalink_structure ) {

		$link = home_url("?feed=$feed&author=" . $author_id);

	} else {

		$link = get_author_posts_url($author_id);

		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, $feed);



	return $link;

}

1166

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: