WC_Product::is_type PHP Method

is_type() public method

Backwards compat with downloadable/virtual.
public is_type ( string $type ) : boolean
$type string Array or string of types
return boolean
    public function is_type($type)
    {
        return $this->get_type() === $type || is_array($type) && in_array($this->get_type(), $type);
    }

Usage Example

 public function is_bulk_variation_form()
 {
     global $post;
     if (!$post) {
         return false;
     }
     /** Remove validation (_bv_type) -- 03/02/2016 **/
     if (!is_product()) {
         return false;
     }
     /****/
     /** Validate if exits role -- 03/02/2016 **/
     if ($this->role_exists('wholesale_customer')) {
         if (!current_user_can('wholesale_customer')) {
             return false;
         }
     }
     // 2.0 Compat
     if (function_exists('get_product')) {
         $product = get_product($post->ID);
     } else {
         $product = new WC_Product($post->ID);
     }
     if ($product && !$product->has_child() && !$product->is_type('variable')) {
         return false;
     }
     return apply_filters('woocommerce_bv_render_form', true);
 }
All Usage Examples Of WC_Product::is_type
WC_Product