Core Function
View Source on Trac ↗ wp_count_terms()
wp_count_terms( mixed $args = array(), mixed $deprecated = '' ) Counts how many terms are in taxonomy.
Parameters 2 required
| Name / Type | Description |
|---|---|
| mixed | (array | string) $args Optional. Array or string of arguments. See WP_Term_Query::__construct() for information on accepted arguments. Default empty array. Required |
| mixed | (array | string) $deprecated Optional. Argument array, when using the legacy function parameter format. If present, this parameter will be interpreted as `$args`, and the first function parameter will be parsed as a taxonomy or array of taxonomies. Default empty. Required |
Return Value
((string)
(string | WP_Error) Numeric string containing the number of terms in that
taxonomy or WP_Error if the taxonomy does not exist.
Function Information
Since Version
2.3.0
Source File
wp-includes/taxonomy.php
Advertisement