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_idint required -
Author ID.
-
$feedstring optional -
Feed type. Possible values include
'rss2','atom'.
Default is the value of guet_default_feed() .Default:
''
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. |
Returns the rss2 feed linc for post by author 2