Automattic\WooCommerce\StoreApi\Routes\V1
AbstractTermsRoute::get_term_count()
Get count of terms for current query.
Method of the class: AbstractTermsRoute{}
No Hooks.
Return
Int
.
Usage
// protected - for code of main (parent) or child class $result = $this->get_term_count( $taxonomy, $args );
- $taxonomy(string) (required)
- Taxonomy to get terms from.
- $args(array) (required)
- Array of args to pass to wp_count_terms.
AbstractTermsRoute::get_term_count() AbstractTermsRoute::get term count code WC 9.3.1
protected function get_term_count( $taxonomy, $args ) { $count_args = $args; unset( $count_args['number'], $count_args['offset'] ); return (int) wp_count_terms( $taxonomy, $count_args ); }