与帖子相关联的XML标记格式的分类术语输出列表
原型
wxr_post_taxonomy()
源文件
路径:wp-admin/includes/export.php
<?php
...
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 "tt<category domain="{$term->taxonomy}" nicename="{$term->slug}">" . wxr_cdata( $term->name ) . "</category>n";
}
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/wxr_post_taxonomy/