wxr_post_taxonomy

The timeline below displays how wordpress function wxr_post_taxonomy has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Outputs list of taxonomy terms, in XML tag format, associated with a post.
 *
 * @since 2.3.0
 */
function wxr_post_taxonomy()
{
    $post = get_post();
    $taxonomies = get_object_taxonomies($post->post_type);
    if (empty($taxonomies)) {
        return;
    }
    $terms = wp_get_object_terms($post->ID, $taxonomies);
    foreach ((array) $terms as $term) {
        echo "\t\t<category domain=\"{$term->taxonomy}\" nicename=\"{$term->slug}\">" . wxr_cdata($term->name) . "</category>\n";
    }
}

WordPress Version: 3.7

/**
 * Output list of taxonomy terms, in XML tag format, associated with a post
 *
 * @since 2.3.0
 */
function wxr_post_taxonomy()
{
    $post = get_post();
    $taxonomies = get_object_taxonomies($post->post_type);
    if (empty($taxonomies)) {
        return;
    }
    $terms = wp_get_object_terms($post->ID, $taxonomies);
    foreach ((array) $terms as $term) {
        echo "\t\t<category domain=\"{$term->taxonomy}\" nicename=\"{$term->slug}\">" . wxr_cdata($term->name) . "</category>\n";
    }
}