wp_count_terms
wp_count_terms ( $args = array(), $deprecated = '' )
Parameters:- (array|string) args Optional. Array or string of arguments. See WP_Term_Query::__construct() for information on accepted arguments. Default empty array.
- (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.
Returns:- (string|WP_Error) Numeric string containing the number of terms in that taxonomy or WP_Error if the taxonomy does not exist.
Defined at:Change Log: - Introduced in WordPress: 2.3.0
- Deprecated in WordPress: —
Description
Counts how many terms are in taxonomy.Default $args is 'hide_empty' which can be 'hide_empty=true' or array('hide_empty' => true).