get_object_taxonomies()获取文章所在的自定义分类

目录

描述

Returns all the taxonomies for a post type or post object

get_object_taxonomies() 描述

用法

<?php get_object_taxonomies$object$output ); ?>

get_object_taxonomies() 用法

参数

$object

(array|string|object) (必填) Name of the post type, or a post object (row from posts)

默认值: None

$output

(string) (可选) The type of output to return, either taxonomy 'names' or 'objects'.

默认值: 'names'

get_object_taxonomies() 参数

返回值

(array) 

All taxonomy names or objects for the given post type/post object

get_object_taxonomies() 返回值

示例

Taxonomy names for post type

will typically output:

Taxonomy objects for post type

If the $output parameter is 'objects', taxonomy objects will be returned as described in get_taxonomies()

will output

Taxonomy names for post object

To get the taxonomies for the current post, the current post object can be passed instead of the post type

will output

get_object_taxonomies() 示例

历史

添加于 版本: 2.3.0

get_object_taxonomies() 历史

源文件

get_object_taxonomies() 函数的代码位于 wp-includes/taxonomy.php.

get_object_taxonomies() 源文件

相关