WC_Product::is_type()
Checks the product type.
Backwards compatibility with downloadable/virtual.
Method of the class: WC_Product{}
No Hooks.
Return
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 8.7.0
public function is_type( $type ) { return ( $this->get_type() === $type || ( is_array( $type ) && in_array( $this->get_type(), $type, true ) ) ); }