woocommerce_duplicate_product_exclude_children

woocommerce_duplicate_product_exclude_children

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.5.1

apply_filters('woocommerce_duplicate_product_exclude_children') is found 1 times:

  • /includes/admin/class-wc-admin-duplicate-product.php line 184
    		// Save parent product.
    		$duplicate->save();
    
    		// Duplicate children of a variable product.
    		if ( ! apply_filters( 'woocommerce_duplicate_product_exclude_children', false, $product ) && $product->is_type( 'variable' ) ) {
    			foreach ( $product->get_children() as $child_id ) {
    				$child           = wc_get_product( $child_id );
    				$child_duplicate = clone $child;
    				$child_duplicate->set_parent_id( $duplicate->get_id() );
    				$child_duplicate->set_id( 0 );
    				$child_duplicate->set_date_created( null );