wpseek.com
A WordPress-centric search engine for devs and theme authors
wp_count_terms › WordPress Function
Since2.3.0
Deprecatedn/a
› wp_count_terms ( $taxonomy, $args = array() )
Parameters: (2) |
|
Returns: |
|
Defined at: |
|
Codex: |
Count how many terms are in Taxonomy.
Default $args is 'hide_empty' which can be 'hide_empty=true' or array('hide_empty' => true).
Source
function wp_count_terms( $taxonomy, $args = array() ) { $defaults = array( 'taxonomy' => $taxonomy, 'hide_empty' => false, ); $args = wp_parse_args( $args, $defaults ); // backward compatibility if ( isset( $args['ignore_empty'] ) ) { $args['hide_empty'] = $args['ignore_empty']; unset( $args['ignore_empty'] ); } $args['fields'] = 'count'; return get_terms( $args ); }