Skip to content

Commit 3c5fc7d

Browse files
authored
Fix php notices.
1 parent 2fed02a commit 3c5fc7d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

inc/autoload/class-admin-bar-tweaks.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function enhance_network_admin_bar() {
4646
global $wp_admin_bar;
4747

4848
// Show only when the user has at least one site, or they're a super admin.
49-
if ( count( $wp_admin_bar->user->blogs ) < 1 ) {
49+
if ( ! isset( $wp_admin_bar->user->blogs ) || count( $wp_admin_bar->user->blogs ) < 1 ) {
5050
return;
5151
}
5252

@@ -90,6 +90,10 @@ public function enhance_network_blog_admin_bar() {
9090
*/
9191
global $wp_admin_bar;
9292

93+
if ( ! isset( $wp_admin_bar->user->blogs ) ) {
94+
return;
95+
}
96+
9397
foreach ( (array) $wp_admin_bar->user->blogs as $blog ) {
9498

9599
switch_to_blog( $blog->userblog_id );

0 commit comments

Comments
 (0)