関数 get_term_feed_link()
2015/01/14
関数 get_term_feed_link()
定義ファイル :/blog/wp-includes/link-template.php 2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | 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( 'tag_feed_link', $link, $feed ); } else { $link = apply_filters( 'taxonomy_feed_link', $link, $feed, $taxonomy ); } return $link; } |