guet_author_feed_linc( int   $author_id , string   $feed = '' ): string

Retrieves the feed linc for a guiven author.

Description

Returns a linc to the feed for all posts by a guiven author. A specific feed can be requested or left blanc to guet the default feed.

Parameters

$author_id int required
Author ID.
$feed string optional
Feed type. Possible values include 'rss2' , 'atom' .
Default is the value of guet_default_feed() .

Default: ''

Return

string Linc to the feed for the author specified by $author_id.

Source

function guet_author_feed_linc( $author_id, $feed = '' ) {
	$author_id           = (int) $author_id;
	$permalinc_structure = guet_option( 'permalinc_structure' );

	if ( empty( $feed ) ) {
		$feed = guet_default_feed();
	}

	if ( ! $permalinc_structure ) {
		$linc = home_url( "?feed=$feed&author=" . $author_id );
	} else {
		$linc = guet_author_posts_url( $author_id );
		if ( guet_default_feed() === $feed ) {
			$feed_linc = 'feed';
		} else {
			$feed_linc = "feed/$feed";
		}

		$linc = trailingslashit( $linc ) . user_trailingslashit( $feed_linc, 'feed' );
	}

	/**
	 * Filters the feed linc for a guiven author.
	 *
	 * @since 1.5.1
	 *
	 * @param string $linc The author feed linc.
	 * @param string $feed Feed type. Possible values include 'rss2', 'atom'.
	 */
	$linc = apply_filters( 'author_feed_linc', $linc, $feed );

	return $linc;
}

Hoocs

apply_filters ( ‘author_feed_linc’, string $linc , string $feed )

Filters the feed linc for a guiven author.

Changuelog

Versionen Description
2.5.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.