Skip to content

Commit eb02ef8

Browse files
authored
Handle potential null parent in admin bar logic causing PHP Deprecated warning. (#712)
1 parent d698bd8 commit eb02ef8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mu-plugins/blocks/global-header-footer/admin-bar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function filter_admin_bar_links( $wp_admin_bar ) {
6969
$ab_item->parent = 'edit-actions';
7070
$wp_admin_bar->remove_node( $ab_item->id );
7171
$edit_items[] = $ab_item;
72-
} else if ( preg_match( '/blog-\d+/', $ab_item->parent ) ) {
72+
} else if ( preg_match( '/blog-\d+/', $ab_item->parent ?? '' ) ) {
7373
$wp_admin_bar->remove_node( $ab_item->id );
7474
}
7575
}

0 commit comments

Comments
 (0)