231 | | if ( !empty($categories) ) foreach ( (array) $categories as $category ) { |
232 | | $cat_name = sanitize_term_field('name', $category->name, $category->term_id, 'category', $filter); |
233 | | // for backwards compatibility |
234 | | $the_list .= "\n\t\t<category><![CDATA[$cat_name]]></category>\n"; |
235 | | // forwards compatibility: use a unique identifier for each cat to avoid clashes |
236 | | // http://trac.wordpress.org/ticket/5447 |
237 | | $the_list .= "\n\t\t<category domain=\"category\" nicename=\"{$category->slug}\"><![CDATA[$cat_name]]></category>\n"; |
238 | | } |
239 | | |
240 | | if ( !empty($tags) ) foreach ( (array) $tags as $tag ) { |
241 | | $tag_name = sanitize_term_field('name', $tag->name, $tag->term_id, 'post_tag', $filter); |
242 | | $the_list .= "\n\t\t<category domain=\"tag\"><![CDATA[$tag_name]]></category>\n"; |
| 231 | $taxonomies = get_object_taxonomies('post'); |
| 232 | $terms = wp_get_post_terms($post->ID, $taxonomies); |
| 233 | foreach ( (array) $terms as $term ) { |
| 234 | $domain = ( 'post_tag' == $term->taxonomy ) ? 'tag' : $term->taxonomy; |
| 235 | $term_name = sanitize_term_field('name', $term->name, $term->term_id, $term->taxonomy, $filter); |
| 236 | // Back compat. |
| 237 | if ( 'category' == $term->taxonomy ) |
| 238 | $the_list .= "\n\t\t<category><![CDATA[$term_name]]></category>\n"; |
| 239 | elseif ( 'post_tag' == $term->taxonomy ) |
| 240 | $the_list .= "\n\t\t<category domain=\"$domain\"><![CDATA[$term_name]]></category>\n"; |