Prevent duplicate actions from firing in shipping settings

This commit is contained in:
claudiulodro 2018-10-03 15:43:11 -04:00
parent 4cbdcf2d1b
commit 1716538617
1 changed files with 3 additions and 4 deletions

View File

@ -174,8 +174,11 @@ class WC_Settings_Shipping extends WC_Settings_Page {
switch ( $current_section ) {
case 'options':
WC_Admin_Settings::save_fields( $this->get_settings() );
do_action( 'woocommerce_update_options_' . $this->id . '_options' );
break;
case 'classes':
do_action( 'woocommerce_update_options_' . $this->id . '_classes' );
break;
case '':
break;
default:
@ -189,10 +192,6 @@ class WC_Settings_Shipping extends WC_Settings_Page {
break;
}
if ( $current_section ) {
do_action( 'woocommerce_update_options_' . $this->id . '_' . $current_section );
}
// Increments the transient version to invalidate cache.
WC_Cache_Helper::get_transient_version( 'shipping', true );
}