WordPress at a glance
function is not described

WC_API_Taxes::get_tax_classes_count() public WC 2.5.0

Get the total number of tax classes

{} It's a method of the class: WC_API_Taxes{}

No Hooks.

Return

Array|WP_Error.

Usage

$WC_API_Taxes = new WC_API_Taxes();
$WC_API_Taxes->get_tax_classes_count();

Changelog

Since 2.5.0 Introduced.

Code of WC_API_Taxes::get_tax_classes_count() WC 5.0.0

<?php
public function get_tax_classes_count() {
	try {
		if ( ! current_user_can( 'manage_woocommerce' ) ) {
			throw new WC_API_Exception( 'woocommerce_api_user_cannot_read_tax_classes_count', __( 'You do not have permission to read the tax classes count', 'woocommerce' ), 401 );
		}

		$total = count( WC_Tax::get_tax_classes() ) + 1; // +1 for Standard Rate

		return array( 'count' => $total );
	} catch ( WC_API_Exception $e ) {
		return new WP_Error( $e->getErrorCode(), $e->getMessage(), array( 'status' => $e->getCode() ) );
	}
}