WC_Tax::is_compound()
Return true/false depending on if a rate is a compound rate.
Method of the class: WC_Tax{}
Hooks from the method
Return
true|false
.
Usage
$result = WC_Tax::is_compound( $key_or_rate );
- $key_or_rate(mixed) (required)
- Tax rate ID, or the db row itself in object format.
WC_Tax::is_compound() WC Tax::is compound code WC 9.5.1
public static function is_compound( $key_or_rate ) { global $wpdb; if ( is_object( $key_or_rate ) ) { $key = $key_or_rate->tax_rate_id; $compound = $key_or_rate->tax_rate_compound; } else { $key = $key_or_rate; $compound = (bool) $wpdb->get_var( $wpdb->prepare( "SELECT tax_rate_compound FROM {$wpdb->prefix}woocommerce_tax_rates WHERE tax_rate_id = %s", $key ) ); } return (bool) apply_filters( 'woocommerce_rate_compound', $compound, $key ); }