woocommerce_product_importer_read_attribute
Filter product attribute after initialization.
Использование
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(массив)
- The attribute data.
- $product(WC_Product)
- The product object.
Список изменений
| С версии 10.6.0 | Введена. |
Где вызывается хук
woocommerce_product_importer_read_attribute
woocommerce/includes/import/abstract-wc-product-importer.php 496
$attributes[] = apply_filters( 'woocommerce_product_importer_read_attribute', $attribute_object, $attribute, $product );
woocommerce/includes/import/abstract-wc-product-importer.php 513
$attributes[] = apply_filters( 'woocommerce_product_importer_read_attribute', $attribute_object, $attribute, $product );