wp_count_terms

SummerySummery

Count how many terms are in Taxonomy.

Syntax

wp_count_terms( string $taxonomy, array|string $args = array() )

DescriptionDescription

Default $args is ‘hide_empty’ which can be ‘hide_empty=true’ or array(‘hide_empty’ => true).

ParametersParameters

$taxonomy

(string) (Required) Taxonomy name.

$args

(array|string) (Optional) Array of arguments that get passed to get_terms().

Default value: array()

ReturnReturn

(array|int|WP_Error) Number of terms in that taxonomy or WP_Error if the taxonomy does not exist.

SourceSource

File: wp-includes/taxonomy.php


			

ChangelogChangelog

Changelog
Version Description
2.3.0 Introduced.
Scroll to Top