Merge pull request #22868 from woocommerce/fix/22743

Get insert ID before running actions
This commit is contained in:
Mike Jolley 2019-02-27 11:17:15 +00:00 committed by GitHub
commit e3c474b563
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -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;
}
/**