get_term_feed_link [ WordPress Function ]
get_term_feed_link ( $term_id, $taxonomy = 'category', $feed = '' )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Soorgelijke functies: get_tag_feed_link, get_category_feed_link, get_term_link, get_search_feed_link, get_author_feed_link
Retrieve the feed link for a term.
Returns a link to the feed for all posts in a given term. A specific feed can be requested or left blank to get the default feed.
Source
<?php
function get_term_feed_link( $term_id, $taxonomy = 'category', $feed = '' ) {
$term_id = ( int ) $term_id;
$term = get_term( $term_id, $taxonomy );
if ( empty( $term ) || is_wp_error( $term ) )
return false;
if ( empty( $feed ) )
$feed = get_default_feed();
$permalink_structure = get_option( 'permalink_structure' );
if ( '' == $permalink_structure ) {
if ( 'category' == $taxonomy ) {
$link = home_url("?feed=$feed&cat=$term_id");
}
elseif ( 'post_tag' == $taxonomy ) {
$link = home_url("?feed=$feed&tag=$term->slug");
} else {
$t = get_taxonomy( $taxonomy );
$link = home_url("?feed=$feed&$t->query_var=$term->slug");
}
} else {
$link = get_term_link( $term_id, $term->taxonomy );
if ( $feed == get_default_feed() )
$feed_link = 'feed';
else
$feed_link = "feed/$feed";
$link = trailingslashit( $link ) . user_trailingslashit( $feed_link, 'feed' );
}
if ( 'category' == $taxonomy )
$link = apply_filters( 'category_feed_link', $link, $feed );
elseif ( 'post_tag' == $taxonomy )
$link = apply_filters( 'category_feed_link', $link, $feed );
else
$link = apply_filters( 'taxonomy_feed_link', $link, $feed, $taxonomy );
return $link;
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- get_term_feed_link (WordPress Function) - WPSeek.com
WordPress lookup for get_term_feed_link, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - get_term_feed_link | A HitchHackers guide through WordPress
Feb 12, 2011 ... function get_term_feed_link( $term_id, $taxonomy = 'category', $feed = '' ) { global $wp_rewrite; $term_id = ( int ) $term_id; $term = get_term( ...
hitchhackerguide.com - #18351 (get_term_feed_link doesn't work well on page two of ...
If you use get_term_feed_link to display the feed for an archive, for the first archive page the feed link is displayed correctly but it breaks on subsequent pages ...
core.trac.wordpress.org - WordPress › Support » Tags — get_term_feed_link
Forums. Username or Email Address Password (forgot?) Register · WordPress › Support » get_term_feed_link. Tag: get_term_feed_link Add New » · Developer ...
wordpress.org