woocommerce_product_duplicate_before_save
This action can be used to modify the object further before it is created - it will be passed by reference.
Usage
add_action( 'woocommerce_product_duplicate_before_save', 'wp_kama_woocommerce_product_duplicate_before_save_action', 10, 2 );
/**
* Function for `woocommerce_product_duplicate_before_save` action-hook.
*
* @param $duplicate
* @param $product
*
* @return void
*/
function wp_kama_woocommerce_product_duplicate_before_save_action( $duplicate, $product ){
// action...
}
- $duplicate
- -
- $product
- -
Changelog
| Since 3.0 | Introduced. |
Where the hook is called
woocommerce_product_duplicate_before_save
woocommerce/includes/admin/class-wc-admin-duplicate-product.php 186
do_action( 'woocommerce_product_duplicate_before_save', $duplicate, $product );
woocommerce/includes/admin/class-wc-admin-duplicate-product.php 233
do_action( 'woocommerce_product_duplicate_before_save', $child_duplicate, $child );
Where the hook is used in WooCommerce
woocommerce/includes/class-wc-brands.php 52
add_action( 'woocommerce_product_duplicate_before_save', array( $this, 'duplicate_store_temporary_brands' ), 10, 2 );