Automattic\WooCommerce\StoreApi\Routes\V1

AbstractTermsRoute::get_term_count()protectedWC 1.0

Get count of terms for current query.

Метод класса: AbstractTermsRoute{}

Хуков нет.

Возвращает

int.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_term_count( $taxonomy, $args );
$taxonomy(строка) (обязательный)
Taxonomy to get terms from.
$args(массив) (обязательный)
Array of args to pass to wp_count_terms.

Код AbstractTermsRoute::get_term_count() 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 );
}