wp_count_terms() WP 1.0
Count how many terms are in Taxonomy.
Default $args is 'hide_empty' which can be 'hide_empty=true' or array('hide_empty' => true).
Works based on: get_terms()
1 time = 0.000664s = slow | 50000 times = 26s = slow
No Hooks.
Return
Array/Int/WP_Error. Number of terms in that taxonomy or WP_Error if the taxonomy does not exist.
Usage
wp_count_terms( $args, $deprecated );
- $args(array/string)
- Array of arguments that get passed to get_terms().
Default: empty array - $deprecated(array/string)
- 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: ''
Changelog
Since 2.3.0 | Introduced. |
Since 5.6.0 | Changed the function signature so that the $args array can be provided as the first parameter. |
Code of wp_count_terms() wp count terms WP 5.6
Related Functions
From tag: counts (counting of any)
More from category: Any taxonomy
- edit_term_link()
- get_edit_term_link()
- get_taxonomies()
- get_taxonomy()
- get_term()
- get_term_by()
- get_term_children()
- get_term_field()
- get_term_link()