woocommerce_product_importer_read_attribute
Filter product attribute after initialization.
Usage
add_filter( 'woocommerce_product_importer_read_attribute', 'wp_kama_woocommerce_product_importer_read_attribute_filter', 10, 3 );
/**
* Function for `woocommerce_product_importer_read_attribute` filter-hook.
*
* @param WC_Product_Attribute $attribute_object The attribute object.
* @param array $attribute The attribute data.
* @param WC_Product $product The product object.
*
* @return WC_Product_Attribute
*/
function wp_kama_woocommerce_product_importer_read_attribute_filter( $attribute_object, $attribute, $product ){
// filter...
return $attribute_object;
}
- $attribute_object(WC_Product_Attribute)
- The attribute object.
- $attribute(array)
- The attribute data.
- $product(WC_Product)
- The product object.
Changelog
| Since 10.6.0 | Introduced. |
Where the hook is called
woocommerce_product_importer_read_attribute
woocommerce/includes/import/abstract-wc-product-importer.php 427
$attributes[] = apply_filters( 'woocommerce_product_importer_read_attribute', $attribute_object, $attribute, $product );
woocommerce/includes/import/abstract-wc-product-importer.php 444
$attributes[] = apply_filters( 'woocommerce_product_importer_read_attribute', $attribute_object, $attribute, $product );