WordPress、get_categories、分类法
我有一个非常简单的问题,WordPress Codex 上没有回答。
get_categories() 函数获取分类法选项。我想问的是,我可以通过多个这样的分类法吗:
get_categories(
array(
'taxonomies' => 'category,my_custom_taxonomy'
)
);
I have a very simple question that is not answered on WordPress Codex.
The get_categories() function get an option for taxonomies. What I like to ask is, can I pass more than one taxonomies like that:
get_categories(
array(
'taxonomies' => 'category,my_custom_taxonomy'
)
);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
get_categories 函数仅允许为分类参数输入字符串(1 个分类)。
您可以使用 get_terms ,它允许一系列分类法。
The get_categories function only allows a string (1 taxonomy) to be entered for the taxonomy arg.
You can use get_terms which allows an array of taxonomies.