Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed #14

  • Loading branch information...
commit 353cfd026ddd3b90d8ac5eea55d81f573056c92e 1 parent e44accc
@bueltge authored
Showing with 9 additions and 4 deletions.
  1. +9 −4 remove-comments-absolute.php
View
13 remove-comments-absolute.php
@@ -45,8 +45,7 @@ public function __construct() {
// change admin bar items
add_action( 'wp_before_admin_bar_render', array( $this, 'admin_bar_render' ) );
- if ( is_multisite() && is_plugin_active_for_network( plugin_basename( __FILE__ ) ) )
- add_action( 'admin_bar_menu', array( $this, 'remove_network_comment_items' ), 500 );
+ add_action( 'admin_bar_menu', array( $this, 'remove_network_comment_items' ), 500 );
// remove string on frontend in Theme
add_filter( 'gettext', array( $this, 'remove_theme_string' ), 20, 3 );
@@ -299,8 +298,14 @@ public function remove_network_comment_items( $wp_admin_bar ) {
if ( ! is_admin_bar_showing() )
return NULL;
- foreach( (array) $wp_admin_bar->user->blogs as $blog )
- $wp_admin_bar->remove_menu( 'blog-' . $blog->userblog_id . '-c' );
+ if ( ! function_exists( 'is_plugin_active_for_network' ) )
+ require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
+
+ if ( is_multisite() && is_plugin_active_for_network( plugin_basename( __FILE__ ) ) ) {
+
+ foreach( (array) $wp_admin_bar->user->blogs as $blog )
+ $wp_admin_bar->remove_menu( 'blog-' . $blog->userblog_id . '-c' );
+ }
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.