From 1cf0c78beb840a5c40e45a95d2002c20d8d4f496 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Wed, 4 Jul 2018 16:04:47 -0300 Subject: [PATCH] Prevents "Your settings have been saved." notices on the table list --- includes/admin/class-wc-admin-menus.php | 2 +- includes/admin/class-wc-admin-webhooks.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/admin/class-wc-admin-menus.php b/includes/admin/class-wc-admin-menus.php index 0648082afde..e15c6b3fe78 100644 --- a/includes/admin/class-wc-admin-menus.php +++ b/includes/admin/class-wc-admin-menus.php @@ -100,7 +100,7 @@ class WC_Admin_Menus { // Save settings if data has been posted. if ( '' !== $current_section && apply_filters( "woocommerce_save_settings_{$current_tab}_{$current_section}", ! empty( $_POST ) ) ) { // WPCS: input var okay, CSRF ok. WC_Admin_Settings::save(); - } elseif ( apply_filters( "woocommerce_save_settings_{$current_tab}", ! empty( $_POST ) ) ) { // WPCS: input var okay, CSRF ok. + } elseif ( '' === $current_section && apply_filters( "woocommerce_save_settings_{$current_tab}", ! empty( $_POST ) ) ) { // WPCS: input var okay, CSRF ok. WC_Admin_Settings::save(); } diff --git a/includes/admin/class-wc-admin-webhooks.php b/includes/admin/class-wc-admin-webhooks.php index e1d429ca4dd..abe82d2df79 100644 --- a/includes/admin/class-wc-admin-webhooks.php +++ b/includes/admin/class-wc-admin-webhooks.php @@ -19,7 +19,7 @@ class WC_Admin_Webhooks { public function __construct() { add_action( 'admin_init', array( $this, 'actions' ) ); add_action( 'woocommerce_settings_page_init', array( $this, 'screen_option' ) ); - add_filter( 'woocommerce_save_settings_api_webhooks', array( $this, 'allow_save_settings' ) ); + add_filter( 'woocommerce_save_settings_advanced_webhooks', array( $this, 'allow_save_settings' ) ); } /** @@ -30,7 +30,7 @@ class WC_Admin_Webhooks { * @return bool */ public function allow_save_settings( $allow ) { - if ( ! isset( $_GET['edit-webhook'] ) ) {// WPCS: input var okay, CSRF ok. + if ( ! isset( $_GET['edit-webhook'] ) ) { // WPCS: input var okay, CSRF ok. return false; }