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.

Метод класса: WC_Product{}

Хуки из метода


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


$WC_Product = new WC_Product();
$WC_Product->supports( $feature );
$feature(строка) (обязательный)
string The name of a feature to test support for.

Список изменений

С версии 2.5.0 Введена.

Код WC_Product::supports() WC 7.3.0

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