WC_Product::is_type
Checks the product type.
Backwards compatibility with downloadable/virtual.
Method of the class: WC_Product{}
No Hooks.
Returns
true|false.
Usage
$WC_Product = new WC_Product(); $WC_Product->is_type( $type );
- $type(string|array) (required)
- Array or string of types.
WC_Product::is_type() WC Product::is type code WC 10.6.2
public function is_type( $type ) {
return ( $this->get_type() === $type || ( is_array( $type ) && in_array( $this->get_type(), $type, true ) ) );
}