diff --git a/inc/autoload/class-admin-bar-tweaks.php b/inc/autoload/class-admin-bar-tweaks.php index 6ef79c5..ab92e57 100755 --- a/inc/autoload/class-admin-bar-tweaks.php +++ b/inc/autoload/class-admin-bar-tweaks.php @@ -46,7 +46,7 @@ public function enhance_network_admin_bar() { global $wp_admin_bar; // Show only when the user has at least one site, or they're a super admin. - if ( count( $wp_admin_bar->user->blogs ) < 1 ) { + if ( ! isset( $wp_admin_bar->user->blogs ) || count( $wp_admin_bar->user->blogs ) < 1 ) { return; } @@ -90,6 +90,10 @@ public function enhance_network_blog_admin_bar() { */ global $wp_admin_bar; + if ( ! isset( $wp_admin_bar->user->blogs ) ) { + return; + } + foreach ( (array) $wp_admin_bar->user->blogs as $blog ) { switch_to_blog( $blog->userblog_id );