Helper: Remove some legacy updater notices

This commit is contained in:
Konstantin Kovshenin 2017-05-24 18:10:31 +03:00
parent e8afe57593
commit 353eac70ca
1 changed files with 10 additions and 0 deletions

View File

@ -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' ) );