diff --git a/class-tgm-plugin-activation.php b/class-tgm-plugin-activation.php index db3eaf19..a4fd86a0 100755 --- a/class-tgm-plugin-activation.php +++ b/class-tgm-plugin-activation.php @@ -233,13 +233,16 @@ public function init() { array_multisort( $sorted, SORT_ASC, $this->plugins ); - add_action( 'admin_menu', array( $this, 'admin_menu' ) ); + $ms_hook = is_multisite() ? 'network_' : ''; + + add_action( $ms_hook . 'admin_menu', array( $this, 'admin_menu' ) ); add_action( 'admin_head', array( $this, 'dismiss' ) ); add_filter( 'install_plugin_complete_actions', array( $this, 'actions' ) ); add_action( 'switch_theme', array( $this, 'flush_plugins_cache' ) ); if ( $this->has_notices ) { - add_action( 'admin_notices', array( $this, 'notices' ) ); + // @todo: add notice for individual sites that the network admin needs to do something ? + add_action( $ms_hook . 'admin_notices', array( $this, 'notices' ) ); add_action( 'admin_init', array( $this, 'admin_init' ), 1 ); add_action( 'admin_enqueue_scripts', array( $this, 'thickbox' ) ); add_action( 'switch_theme', array( $this, 'update_dismiss' ) ); @@ -318,8 +321,11 @@ public function admin_init() { */ public function thickbox() { - if ( ! get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, true ) ) { - add_thickbox(); + if ( ! is_multisite() || ( is_multisite() && is_network_admin() ) ) { + + if ( ! get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, true ) ) { + add_thickbox(); + } } }