Changeset 6365 for trunk/wp-includes/feed.php
- Timestamp:
- 12/06/2007 07:58:15 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/feed.php
r6364 r6365 6 6 } 7 7 8 9 8 function bloginfo_rss($show = '') { 10 9 echo apply_filters('bloginfo_rss', get_bloginfo_rss($show)); 10 } 11 12 function get_default_feed() { 13 return apply_filters('default_feed', 'rss2'); 11 14 } 12 15 … … 81 84 } 82 85 83 84 86 function get_comment_author_rss() { 85 87 return apply_filters('comment_author_rss', get_comment_author() ); 86 88 } 87 89 88 89 90 function comment_author_rss() { 90 91 echo get_comment_author_rss(); 91 92 } 92 93 93 94 94 function comment_text_rss() { … … 98 98 } 99 99 100 101 function comments_rss_link($link_text = 'Comments RSS', $deprecated = '') {102 $url = get_post_comments_feed_link();103 echo "<a href='$url'>$link_text</a>";104 }105 106 107 100 function comments_rss($deprecated = '') { 108 101 return get_post_comments_feed_link(); 109 102 } 110 111 112 function get_author_rss_link($echo = false, $author_id, $author_nicename) {113 $author_id = (int) $author_id;114 $permalink_structure = get_option('permalink_structure');115 116 if ( '' == $permalink_structure ) {117 $link = get_option('home') . '?feed=rss2&author=' . $author_id;118 } else {119 $link = get_author_posts_url($author_id, $author_nicename);120 $link = trailingslashit($link) . user_trailingslashit('feed', 'feed');121 }122 123 $link = apply_filters('author_feed_link', $link);124 125 if ( $echo )126 echo $link;127 return $link;128 }129 130 /** get_category_feed_link() - Get the feed link for a given category131 *132 * Returns a link to the feed for all post in a given category. A specific feed can be requested133 * or left blank to get the default feed.134 *135 * @package WordPress136 * @subpackage Feed137 * @since 2.4138 *139 * @param int $cat_id ID of a category140 * @param string $feed Feed type141 * @return string Link to the feed for the category specified by $cat_id142 */143 function get_category_feed_link($cat_id, $feed = 'rss2') {144 $cat_id = (int) $cat_id;145 146 $category = get_category($cat_id);147 148 if ( empty($category) || is_wp_error($category) )149 return false;150 151 $permalink_structure = get_option('permalink_structure');152 153 if ( '' == $permalink_structure ) {154 $link = get_option('home') . "?feed=$feed&cat=" . $cat_id;155 } else {156 $link = get_category_link($cat_id);157 if( 'rss2' == $feed )158 $feed_link = 'feed';159 else160 $feed_link = "feed/$feed";161 162 $link = trailingslashit($link) . user_trailingslashit($feed_link, 'feed');163 }164 165 $link = apply_filters('category_feed_link', $link, $feed);166 167 return $link;168 }169 170 171 function get_category_rss_link($echo = false, $cat_ID, $deprecated = '') {172 $link = get_category_feed_link($cat_ID, 'rss2');173 174 if ( $echo )175 echo $link;176 return $link;177 }178 179 103 180 104 function get_the_category_rss($type = 'rss') { … … 210 134 } 211 135 212 213 136 function the_category_rss($type = 'rss') { 214 137 echo get_the_category_rss($type); 215 }216 217 function get_tag_feed_link($tag_id, $feed = 'rss2') {218 $tag_id = (int) $tag_id;219 220 $tag = get_tag($tag_id);221 222 if ( empty($tag) || is_wp_error($tag) )223 return false;224 225 $permalink_structure = get_option('permalink_structure');226 227 if ( '' == $permalink_structure ) {228 $link = get_option('home') . "?feed=$feed&tag=" . $tag->slug;229 } else {230 $link = get_tag_link($tag->term_id);231 if ( 'rss2' == $feed )232 $feed_link = 'feed';233 else234 $feed_link = "feed/$feed";235 $link = $link . user_trailingslashit($feed_link, 'feed');236 }237 238 $link = apply_filters('tag_feed_link', $link, $feed);239 240 return $link;241 138 } 242 139
Note: See TracChangeset
for help on using the changeset viewer.