Merge pull request #22868 from woocommerce/fix/22743
Get insert ID before running actions
This commit is contained in:
commit
e3c474b563
|
@ -882,11 +882,13 @@ class WC_Tax {
|
|||
|
||||
$wpdb->insert( $wpdb->prefix . 'woocommerce_tax_rates', self::prepare_tax_rate( $tax_rate ) );
|
||||
|
||||
$tax_rate_id = $wpdb->insert_id;
|
||||
|
||||
WC_Cache_Helper::incr_cache_prefix( 'taxes' );
|
||||
|
||||
do_action( 'woocommerce_tax_rate_added', $wpdb->insert_id, $tax_rate );
|
||||
do_action( 'woocommerce_tax_rate_added', $tax_rate_id, $tax_rate );
|
||||
|
||||
return $wpdb->insert_id;
|
||||
return $tax_rate_id;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue