Automattic\WooCommerce\StoreApi\Routes\V1
AbstractTermsRoute::get_term_count
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() AbstractTermsRoute::get term count WC 11.3.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 );
}