Changeset 5979 for trunk/wp-includes/feed.php
- Timestamp:
- 08/29/2007 09:10:20 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/feed.php
r5910 r5979 147 147 function get_the_category_rss($type = 'rss') { 148 148 $categories = get_the_category(); 149 $tags = get_the_tags(); 149 150 $home = get_bloginfo_rss('home'); 150 151 $the_list = ''; 151 foreach ( (array) $categories as $category ) { 152 $cat_name = convert_chars($category->name); 152 $cat_names = array(); 153 154 $filter = 'rss'; 155 if ( 'atom' == $type ) 156 $filter = 'raw'; 157 158 if ( !empty($categories) ) foreach ( (array) $categories as $category ) { 159 $cat_names[] = sanitize_term_field('name', $category->name, $category->term_id, 'category', $filter); 160 } 161 162 if ( !empty($tags) ) foreach ( (array) $tags as $tag ) { 163 $cat_names[] = sanitize_term_field('name', $tag->name, $tag->term_id, 'post_tag', $filter); 164 } 165 166 $cat_names = array_unique($cat_names); 167 168 foreach ( $cat_names as $cat_name ) { 153 169 if ( 'rdf' == $type ) 154 170 $the_list .= "\n\t\t<dc:subject><![CDATA[$cat_name]]></dc:subject>\n"; 155 171 if ( 'atom' == $type ) 156 $the_list .= sprintf( '<category scheme="%1$s" term="%2$s" />', attribute_escape( apply_filters( 'get_bloginfo_rss', get_bloginfo( 'url' ) ) ), attribute_escape( $cat egory->name ) );172 $the_list .= sprintf( '<category scheme="%1$s" term="%2$s" />', attribute_escape( apply_filters( 'get_bloginfo_rss', get_bloginfo( 'url' ) ) ), attribute_escape( $cat_name ) ); 157 173 else 158 174 $the_list .= "\n\t\t<category><![CDATA[$cat_name]]></category>\n"; 159 175 } 176 160 177 return apply_filters('the_category_rss', $the_list, $type); 161 178 }
Note: See TracChangeset
for help on using the changeset viewer.