get_categories()
get_categories( string|array $args = ” )
检索类别对象列表。
Retrieve list of category objects.
说明(Description)
另见函数 get_terms()
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$args | (string | array) | 可选 | 检索类别的参数。有关其他选项,请参见get_terms()分类法’(字符串)检索术语的分类法。默认“类别”。 |
返回(Return)
(array)类别对象列表。
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
2.1.0 | wp-includes/category.php:25 | 7 | 8 |
笔记(Notes)
列出类别和说明
函数只返回帖子使用的类别
仅获取顶级类别
get_categories() 为WP2原创文章,链接:https://www.wp2.cn/functions/get_categories/