Skip to content
This repository was archived by the owner on Mar 17, 2022. It is now read-only.

Commit 29f4895

Browse files
committed
fixes #356
make action hook more precise to reduce number of calls
1 parent 42db06e commit 29f4895

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Hyyan/WPI/Product/Variable.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class Variable
2828
public function __construct()
2929
{
3030
// Handle variations duplication
31-
add_action('save_post', array($this, 'duplicateVariations'), 10, 3);
32-
add_action('save_post', array($this, 'syncDefaultAttributes'), 10, 3);
31+
add_action( 'save_post_product', array( $this, 'duplicateVariations' ), 10, 3 );
32+
add_action( 'save_post_product', array( $this, 'syncDefaultAttributes' ), 10, 3 );
3333

3434
// Remove variations
3535
add_action('wp_ajax_woocommerce_remove_variations', array($this, 'removeVariations'), 9);

0 commit comments

Comments
 (0)