Skip to content

Commit

Permalink
Fix php notices.
Browse files Browse the repository at this point in the history
  • Loading branch information
bueltge authored Feb 25, 2019
1 parent 2fed02a commit 3c5fc7d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion inc/autoload/class-admin-bar-tweaks.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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 );
Expand Down

0 comments on commit 3c5fc7d

Please sign in to comment.