From 9e53b3fb3316c6b9111b13917a2a028fb01096cb Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Tue, 11 Nov 2014 16:22:26 +0000 Subject: [PATCH] Clear shipping transient on save Closes #6723 --- includes/admin/settings/class-wc-settings-shipping.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/admin/settings/class-wc-settings-shipping.php b/includes/admin/settings/class-wc-settings-shipping.php index 269bca844d3..d29071028a1 100644 --- a/includes/admin/settings/class-wc-settings-shipping.php +++ b/includes/admin/settings/class-wc-settings-shipping.php @@ -260,7 +260,7 @@ class WC_Settings_Shipping extends WC_Settings_Page { * Save settings */ public function save() { - global $current_section; + global $current_section, $wpdb; if ( ! $current_section ) { @@ -275,6 +275,8 @@ class WC_Settings_Shipping extends WC_Settings_Page { do_action( 'woocommerce_update_options_' . $this->id . '_' . $current_section_class->id ); } + + $wpdb->query( "DELETE FROM `$wpdb->options` WHERE `option_name` LIKE ('_transient_wc_ship_%') OR `option_name` LIKE ('_transient_timeout_wc_ship_%')" ); } }