wp_count_terms ( $args = array(), $deprecated = '' )

  • (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.
  • (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:
  • 5: .


Counts how many terms are in taxonomy.Default $args is 'hide_empty' which can be 'hide_empty=true' or array('hide_empty' => true).

Related Functions

wp_count_sites, count_users, wp_create_term, wp_get_post_terms, wp_count_posts

Top Google Results

User discussions

wpseek mobile