WC_Product::supports()publicWC 2.5.0

Check if a product supports a given feature.

Product classes should override this to declare support (or lack of support) for a feature.

Method of the class: WC_Product{}

Hooks from the method

Returns

true|false. True if the product supports the feature, false otherwise.

Usage

$WC_Product = new WC_Product();
$WC_Product->supports( $feature );
$feature(string) (required)
string The name of a feature to test support for.

Changelog

Since 2.5.0 Introduced.

WC_Product::supports() code WC 9.8.5

public function supports( $feature ) {
	return apply_filters( 'woocommerce_product_supports', in_array( $feature, $this->supports, true ), $feature, $this );
}