wp_count_terms(): Count Terms in a Taxonomy

Description

Counts how many terms exist in a taxonomy.

The default $args value is 'hide_empty'. It can also be provided as 'hide_empty=true' or as array('hide_empty' => true).

Usage

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

Parameters

$taxonomy
(string) (required) The taxonomy name.
Default: string

$args
(mixed) (optional) Overrides the default arguments. See get_terms().
Default: array/string

Return value

(int)
The total number of terms in $taxonomy.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *