Merge pull request #18609 from woocommerce/fix/18608-add-missing-action-settings-save

Add missing action for settings pages that override save method
This commit is contained in:
Mike Jolley 2018-02-19 14:43:58 +00:00 committed by GitHub
commit 0996264e7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 0 deletions

View File

@ -373,6 +373,10 @@ class WC_Settings_Payment_Gateways extends WC_Settings_Page {
}
}
}
if ( $current_section ) {
do_action( 'woocommerce_update_options_' . $this->id . '_' . $current_section );
}
}
}

View File

@ -99,6 +99,10 @@ class WC_Settings_Products extends WC_Settings_Page {
$settings = $this->get_settings( $current_section );
WC_Admin_Settings::save_fields( $settings );
if ( $current_section ) {
do_action( 'woocommerce_update_options_' . $this->id . '_' . $current_section );
}
}
/**

View File

@ -146,6 +146,10 @@ class WC_Settings_Rest_API extends WC_Settings_Page {
if ( apply_filters( 'woocommerce_rest_api_valid_to_save', ! in_array( $current_section, array( 'keys', 'webhooks' ), true ) ) ) {
$settings = $this->get_settings();
WC_Admin_Settings::save_fields( $settings );
if ( $current_section ) {
do_action( 'woocommerce_update_options_' . $this->id . '_' . $current_section );
}
}
}
}

View File

@ -186,6 +186,10 @@ 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 );
}

View File

@ -118,6 +118,10 @@ class WC_Settings_Tax extends WC_Settings_Page {
$this->save_tax_rates();
}
if ( $current_section ) {
do_action( 'woocommerce_update_options_' . $this->id . '_' . $current_section );
}
// Invalidate caches.
WC_Cache_Helper::incr_cache_prefix( 'taxes' );
WC_Cache_Helper::get_transient_version( 'shipping', true );