Prevents "Your settings have been saved." notices on the table list
This commit is contained in:
parent
7e94f45f12
commit
1cf0c78beb
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue