get_taxonomies()获取所有的分类法信息

目录

描述

Get a list of registered taxonomy objects.

get_taxonomies() 描述

用法

 <?php get_taxonomies$args$output$operator ?> 

get_taxonomies() 用法

参数

$args

(array) (可选) An array of key -> value arguments to match against the taxonomies. Only taxonomies having attributes that match all arguments are returned.

默认值: None

  • name
  • object_type (array)
  • label
  • singular_label
  • show_ui
  • show_tagcloud
  • public
  • update_count_callback
  • rewrite
  • query_var
  • manage_cap
  • edit_cap
  • delete_cap
  • assign_cap
  • _builtin

$output

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

默认值: 'names'

$operator

(string) (可选) Operator (and/or) to use with multiple $args.

默认值: and

get_taxonomies() 参数

示例

Default Usage

The call to get_taxonomies returns the registered taxonomies.

Output a list all registered taxonomies

Output a list of all public custom taxonomies

This return all custom (not builtin) taxonomies.

Output a named taxonomy

This example uses the 'object' output to retrieve and display the taxonomy called 'genre':

get_taxonomies() 示例

历史

  • 添加于 版本: 3.0.0

get_taxonomies() 历史

源文件

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

get_taxonomies() 源文件

相关