WC_Product::is_type()publicWC 1.0

Checks the product type.

Backwards compatibility with downloadable/virtual.

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

Хуков нет.

Возвращает

true|false.

Использование

$WC_Product = new WC_Product();
$WC_Product->is_type( $type );
$type(строка|массив) (обязательный)
Array or string of types.

Код WC_Product::is_type() WC 8.7.0

public function is_type( $type ) {
	return ( $this->get_type() === $type || ( is_array( $type ) && in_array( $this->get_type(), $type, true ) ) );
}