wp count terms 统计分类法中的分类项目数量

描述

统计分类法中有多少个分类项目。

默认 $args 为 ‘hide_empty’ ,可以为’hide_empty=true’ 或 array(‘hide_empty’ => true).

使用方法

<?php wp_count_terms( $taxonomy, $args ); ?>

参数

$taxonomy
(string) (必需) 分类法名称
默认: string
$args
(mixed) (可选) 覆盖默认参数,查阅 get_terms().
默认: array/string

返回值

(int)
$taxonomy 的分类项目总数。

Related Posts

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注