3 function get_bloginfo_rss($show = '') {
4 $info = strip_tags(get_bloginfo($show));
5 return apply_filters('get_bloginfo_rss', convert_chars($info));
9 function bloginfo_rss($show = '') {
10 echo apply_filters('bloginfo_rss', get_bloginfo_rss($show));
13 function get_wp_title_rss($sep = '»') {
14 $title = wp_title($sep, false);
15 if ( is_wp_error( $title ) )
16 return $title->get_error_message();
17 $title = apply_filters('get_wp_title_rss', $title);
21 function wp_title_rss($sep = '»') {
22 echo apply_filters('wp_title_rss', get_wp_title_rss($sep));
25 function get_the_title_rss() {
26 $title = get_the_title();
27 $title = apply_filters('the_title_rss', $title);
32 function the_title_rss() {
33 echo get_the_title_rss();
37 function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) {
38 $content = get_the_content($more_link_text, $stripteaser, $more_file);
39 $content = apply_filters('the_content_rss', $content);
40 if ( $cut && !$encode_html )
42 if ( 1== $encode_html ) {
43 $content = wp_specialchars($content);
45 } elseif ( 0 == $encode_html ) {
46 $content = make_url_footnote($content);
47 } elseif ( 2 == $encode_html ) {
48 $content = strip_tags($content);
51 $blah = explode(' ', $content);
52 if ( count($blah) > $cut ) {
59 for ( $i=0; $i<$k; $i++ )
60 $excerpt .= $blah[$i].' ';
61 $excerpt .= ($use_dotdotdot) ? '...' : '';
64 $content = str_replace(']]>', ']]>', $content);
69 function the_excerpt_rss() {
70 $output = get_the_excerpt();
71 echo apply_filters('the_excerpt_rss', $output);
74 function the_permalink_rss() {
75 echo apply_filters('the_permalink_rss', get_permalink());
79 function comment_link() {
80 echo get_comment_link();
84 function get_comment_author_rss() {
85 return apply_filters('comment_author_rss', get_comment_author() );
89 function comment_author_rss() {
90 echo get_comment_author_rss();
94 function comment_text_rss() {
95 $comment_text = get_comment_text();
96 $comment_text = apply_filters('comment_text_rss', $comment_text);
101 function comments_rss_link($link_text = 'Comments RSS', $commentsrssfilename = 'nolongerused') {
102 $url = get_post_comments_feed_link();
103 echo "<a href='$url'>$link_text</a>";
107 function comments_rss($commentsrssfilename = 'nolongerused') {
108 return get_post_comments_feed_link();
112 function get_author_rss_link($echo = false, $author_id, $author_nicename) {
113 $auth_ID = (int) $author_id;
114 $permalink_structure = get_option('permalink_structure');
116 if ( '' == $permalink_structure ) {
117 $link = get_option('home') . '?feed=rss2&author=' . $author_id;
119 $link = get_author_posts_url($author_id, $author_nicename);
120 $link = trailingslashit($link) . user_trailingslashit('feed', 'feed');
123 $link = apply_filters('author_feed_link', $link);
131 function get_category_rss_link($echo = false, $cat_ID, $category_nicename) {
132 $permalink_structure = get_option('permalink_structure');
134 if ( '' == $permalink_structure ) {
135 $link = get_option('home') . '?feed=rss2&cat=' . $cat_ID;
137 $link = get_category_link($cat_ID);
138 $link = trailingslashit($link) . user_trailingslashit('feed', 'feed');
141 $link = apply_filters('category_feed_link', $link);
149 function get_the_category_rss($type = 'rss') {
150 $categories = get_the_category();
151 $tags = get_the_tags();
152 $home = get_bloginfo_rss('home');
154 $cat_names = array();
157 if ( 'atom' == $type )
160 if ( !empty($categories) ) foreach ( (array) $categories as $category ) {
161 $cat_names[] = sanitize_term_field('name', $category->name, $category->term_id, 'category', $filter);
164 if ( !empty($tags) ) foreach ( (array) $tags as $tag ) {
165 $cat_names[] = sanitize_term_field('name', $tag->name, $tag->term_id, 'post_tag', $filter);
168 $cat_names = array_unique($cat_names);
170 foreach ( $cat_names as $cat_name ) {
171 if ( 'rdf' == $type )
172 $the_list .= "\n\t\t<dc:subject><![CDATA[$cat_name]]></dc:subject>\n";
173 elseif ( 'atom' == $type )
174 $the_list .= sprintf( '<category scheme="%1$s" term="%2$s" />', attribute_escape( apply_filters( 'get_bloginfo_rss', get_bloginfo( 'url' ) ) ), attribute_escape( $cat_name ) );
176 $the_list .= "\n\t\t<category><![CDATA[$cat_name]]></category>\n";
179 return apply_filters('the_category_rss', $the_list, $type);
183 function the_category_rss($type = 'rss') {
184 echo get_the_category_rss($type);
187 function get_tag_feed_link($tag_id, $feed = 'rss2') {
188 $tag_id = (int) $tag_id;
190 $tag = get_tag($tag_id);
192 if ( empty($tag) || is_wp_error($tag) )
195 $permalink_structure = get_option('permalink_structure');
197 if ( '' == $permalink_structure ) {
198 $link = get_option('home') . "?feed=$feed&tag=" . $tag->slug;
200 $link = get_tag_link($tag->term_id);
201 if ( 'rss2' == $feed )
204 $feed_link = "feed/$feed";
205 $link = $link . user_trailingslashit($feed_link, 'feed');
208 $link = apply_filters('tag_feed_link', $link, $feed);
213 function html_type_rss() {
214 $type = get_bloginfo('html_type');
215 if (strpos($type, 'xhtml') !== false)
223 function rss_enclosure() {
225 if ( !empty($post->post_password) && ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) )
228 foreach (get_post_custom() as $key => $val) {
229 if ($key == 'enclosure') {
230 foreach ((array)$val as $enc) {
231 $enclosure = split("\n", $enc);
232 echo apply_filters('rss_enclosure', '<enclosure url="' . trim(htmlspecialchars($enclosure[0])) . '" length="' . trim($enclosure[1]) . '" type="' . trim($enclosure[2]) . '" />' . "\n");
238 function atom_enclosure() {
240 if ( !empty($post->post_password) && ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) )
243 foreach (get_post_custom() as $key => $val) {
244 if ($key == 'enclosure') {
245 foreach ((array)$val as $enc) {
246 $enclosure = split("\n", $enc);
247 echo apply_filters('atom_enclosure', '<link href="' . trim(htmlspecialchars($enclosure[0])) . '" rel="enclosure" length="' . trim($enclosure[1]) . '" type="' . trim($enclosure[2]) . '" />' . "\n");