get_post_taxonomies()
get_post_taxonomies( int|WP_Post $post )
检索给定文章的所有分类名称。
Retrieve all taxonomy names for the given post.
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$post | (int | WP_Post) | 可选 | Post ID或WP_Post对象。默认值为全局$post。 |
返回(Return)
(string[])给定文章的所有分类名称的数组。
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
2.5.0 | wp-includes/taxonomy.php:4391 | 0 | 2 |
笔记(Notes)
显示文章的所有分类。
#return部分应该说明,函数返回给定post或post对象的所有分类名称的数组,而不仅仅是一个数组。
get_post_taxonomies() 为WP2原创文章,链接:https://www.wp2.cn/functions/get_post_taxonomies/