Title: get_terms missing arguments
Last modified: June 10, 2019

---

# get_terms missing arguments

 *  [Tushar](https://wordpress.org/support/users/tushar4monto/)
 * (@tushar4monto)
 * [7 years ago](https://wordpress.org/support/topic/get_terms-missing-arguments/)
 * Hello,
 * get_terms its very useful to get taxonomy terms but something is missing with
   arguments like.
 *     ```
       $tax_args = array(
           'taxonomy'    => 'sector',
           'orderby'     => 'name',
           'order'       => 'ASC',
           'fields'      => 'all',
           'hide_empty'  => true,
           'pad_counts'  => true
       );
       $terms = get_terms( $tax_args );
   
       Currently, we get sectors counts with post status draft means pad_counts also count draft  post_status count So, there is should argument parameter for we can pass,
   
       $tax_args = array(
         'taxonomy'    => 'sector',
         'orderby'     => 'name',
         'order'       => 'ASC',
         'fields'      => 'all',
         'hide_empty'  => true,
         'pad_counts'  => true,
         'post_status' => 'publish',
         'post_type'   => 'candidate'
       );
   
       $terms = get_terms( $tax_args );
       ```
   
 * So, it will only count just publish posts count.
 * Thanks & Regards
    Tushar Kataria
    -  This topic was modified 7 years ago by [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/).

Viewing 1 replies (of 1 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [7 years ago](https://wordpress.org/support/topic/get_terms-missing-arguments/#post-11625139)
 * I’m sorry get_terms() does not entirely meet your needs. It’s inevitable that
   WP functions cannot be all things to all people. There will always be an unmet
   need for some because there just isn’t that much of a need for most people. I
   know this is little consolation when it’s _your_ unmet need.
 * Often enough, there is a work around in such cases, though it may be more cumbersome
   and not immediately apparent. In this case, you can alter the SQL clauses actually
   used to get terms, so you can alter the query in any way you see fit, within 
   the limits of mySQL. You can alter SQL clauses through the “terms_clauses” filter.
 * Be sure to only alter the query for your specific need and not any other uses
   of the WP_Term_Query class that happens elsewhere. You can do so by checking 
   for specific query vars and/or selectively adding your callback only as needed
   and removing it after use.

Viewing 1 replies (of 1 total)

The topic ‘get_terms missing arguments’ is closed to new replies.

## Tags

 * [post_status](https://wordpress.org/support/topic-tag/post_status/)
 * [taxonomy](https://wordpress.org/support/topic-tag/taxonomy/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 1 reply
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/get_terms-missing-arguments/#post-11625139)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
