WC_Tax::_get_tax_rate
Get tax rate.
Internal use only.
Method of the class: WC_Tax{}
No Hooks.
Returns
Array|Object.
Usage
$result = WC_Tax::_get_tax_rate( $tax_rate_id, $output_type );
- $tax_rate_id(int) (required)
- Tax rate ID.
- $output_type(string)
- Type of output.
Default:ARRAY_A
Changelog
| Since 2.5.0 | Introduced. |
WC_Tax::_get_tax_rate() WC Tax:: get tax rate code WC 10.7.0
public static function _get_tax_rate( $tax_rate_id, $output_type = ARRAY_A ) {
global $wpdb;
return $wpdb->get_row(
$wpdb->prepare(
"
SELECT *
FROM {$wpdb->prefix}woocommerce_tax_rates
WHERE tax_rate_id = %d
",
$tax_rate_id
),
$output_type
);
}