wc_gzd_product_matches_extended_type

The WooCommerce Germanized wc gzd product matches extended type function.

Description

wc_gzd_product_matches_extended_type( $type, $product ); 

Parameters (2)

0. $type
The type.
1. $product
The product.

Usage

  1. if ( !function_exists( 'wc_gzd_product_matches_extended_type' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-germanized/includes/wc-gzd-product-functions.php'; 
  3.  
  4. // The type. 
  5. $type = null; 
  6.  
  7. // The product. 
  8. $product = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = wc_gzd_product_matches_extended_type($type, $product); 
  12.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-gzd-product-functions.php  
  1. function wc_gzd_product_matches_extended_type( $type, $product ) { 
  2.  
  3. if ( $type === $product->get_type() ) 
  4. return true;  
  5. else if ( is_callable( array( $product, 'is_' . $type ) ) ) 
  6. return ( call_user_func_array( array( $product, 'is_' . $type ), array() ) === true ? true : false ); 
  7.  
  8. return false;