| | 185 | function get_tag_feed_link($tag_id, $feed = 'rss2') { |
|---|
| | 186 | $tag_id = (int) $tag_id; |
|---|
| | 187 | |
|---|
| | 188 | $tag = get_tag($tag_id); |
|---|
| | 189 | |
|---|
| | 190 | if ( empty($tag) || is_wp_error($tag) ) |
|---|
| | 191 | return false; |
|---|
| | 192 | |
|---|
| | 193 | $permalink_structure = get_option('permalink_structure'); |
|---|
| | 194 | |
|---|
| | 195 | if ( '' == $permalink_structure ) { |
|---|
| | 196 | $link = get_option('home') . "?feed=$feed&tag=" . $tag->slug; |
|---|
| | 197 | } else { |
|---|
| | 198 | $link = get_tag_link($tag->term_id); |
|---|
| | 199 | if ( 'rss2' == $feed ) |
|---|
| | 200 | $feed_link = 'feed'; |
|---|
| | 201 | else |
|---|
| | 202 | $feed_link = "feed/$feed"; |
|---|
| | 203 | $link = $link . user_trailingslashit($feed_link, 'feed'); |
|---|
| | 204 | } |
|---|
| | 205 | |
|---|
| | 206 | $link = apply_filters('tag_feed_link', $link, $feed); |
|---|
| | 207 | |
|---|
| | 208 | return $link; |
|---|
| | 209 | } |
|---|
| | 210 | |
|---|