WordPress at Your Fingertips
function is not described

WC_Tax::is_compound() public WC 1.0

Return true/false depending on if a rate is a compound rate.

{} It's a 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.

Code of WC_Tax::is_compound() WC 5.9.0

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