WC_Tax::get_tax_rate_classes()

Gets all tax rate classes from the database.


Description Description


Return Return

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


Top ↑

Source Source

File: includes/class-wc-tax.php

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

Top ↑

Changelog Changelog

Changelog
Version Description
3.7.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.