From 353eac70ca2faaa994eb6abc5b0092940fe055f5 Mon Sep 17 00:00:00 2001 From: Konstantin Kovshenin Date: Wed, 24 May 2017 18:10:31 +0300 Subject: [PATCH] Helper: Remove some legacy updater notices --- includes/admin/helper/class-wc-helper.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/includes/admin/helper/class-wc-helper.php b/includes/admin/helper/class-wc-helper.php index 3d519915320..023e8900324 100644 --- a/includes/admin/helper/class-wc-helper.php +++ b/includes/admin/helper/class-wc-helper.php @@ -42,6 +42,16 @@ class WC_Helper { // Stop the nagging about WooThemes Updater remove_action( 'admin_notices', 'woothemes_updater_notice' ); + // Remove WooThemes Updater notices + if ( ! empty( $GLOBALS['woothemes_updater'] ) ) { + remove_action( 'network_admin_notices', array( $GLOBALS['woothemes_updater']->admin, 'maybe_display_activation_notice' ) ); + remove_action( 'admin_notices', array( $GLOBALS['woothemes_updater']->admin, 'maybe_display_activation_notice' ) ); + remove_action( 'network_admin_menu', array( $GLOBALS['woothemes_updater']->admin, 'register_settings_screen' ) ); + remove_action( 'admin_menu', array( $GLOBALS['woothemes_updater']->admin, 'register_settings_screen' ) ); + + // TODO: In a later version, when things are stable, attempt to deactivate the legacy helper. + } + // Add some nags about extension updates add_action( 'admin_notices', array( __CLASS__, 'admin_notices' ) ); add_filter( 'woocommerce_in_plugin_update_message', array( __CLASS__, 'in_plugin_update_message' ) );