wc_attributes_array_filter_variation

Callback for array filter to get variation attributes only.

Description

wc_attributes_array_filter_variation( (WC_Product_Attribute) $attribute ); 

Parameters (1)

0. $attribute (WC_Product_Attribute)
The attribute.

Usage

  1. if ( !function_exists( 'wc_attributes_array_filter_variation' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-attribute-functions.php'; 
  3.  
  4. // The attribute. 
  5. $attribute = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wc_attributes_array_filter_variation($attribute); 
  9.  

Defined (1)

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

/includes/wc-attribute-functions.php  
  1. function wc_attributes_array_filter_variation( $attribute ) { 
  2. return $attribute && is_a( $attribute, 'WC_Product_Attribute' ) && $attribute->get_variation();