WordPress at Your Fingertips
function is not described

WC_Tax::get_tax_rate_classes() public WC 3.7.0

Gets all tax rate classes from the database.

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

No Hooks.

Return

Array. Array of tax class objects consisting of tax_rate_class_id, name, and slug.

Usage

$result = WC_Tax::get_tax_rate_classes();

Changelog

Since 3.7.0 Introduced.

Code of WC_Tax::get_tax_rate_classes() WC 5.9.0

public static function get_tax_rate_classes() {
	global $wpdb;

	$cache_key        = 'tax-rate-classes';
	$tax_rate_classes = wp_cache_get( $cache_key, 'taxes' );

	if ( ! is_array( $tax_rate_classes ) ) {
		$tax_rate_classes = $wpdb->get_results(
			"
			SELECT * FROM {$wpdb->wc_tax_rate_classes} ORDER BY name;
			"
		);
		wp_cache_set( $cache_key, $tax_rate_classes, 'taxes' );
	}

	return $tax_rate_classes;
}