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.
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; }
Changelog Changelog
Version | Description |
---|---|
3.7.0 | Introduced. |