Automattic\WooCommerce\StoreApi\Routes\V1

AbstractTermsRoute::get_term_count()protectedWC 1.0

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() code WC 8.7.0

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 );
}