【发布时间】:2018-08-03 03:28:40
【问题描述】:
我正在调用 WordPress get_terms 函数,但我想排除多个类别。
为什么这无效?
$terms = get_terms( 'category', 'exclude' = array(1, 238) );
我发现我必须使用这个:
$terms = get_terms( 'category', array('exclude' => array(1, 238),) );
但这似乎是多余的,因为高阶数组中只有一项。
参考文档:https://developer.wordpress.org/reference/functions/get_terms/
【问题讨论】:
标签: php arrays wordpress syntax-error