From 4faa6cfa63ab2f682efd55afb0344e6455e89b90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20W=C3=BCnsch?= Date: Wed, 8 Apr 2026 08:43:48 +0200 Subject: [PATCH 1/2] Admin Bar: Simplify node retrieval using null coalescing operator --- src/wp-includes/class-wp-admin-bar.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/wp-includes/class-wp-admin-bar.php b/src/wp-includes/class-wp-admin-bar.php index 9e7b54823b900..5e7fed77d0d9d 100644 --- a/src/wp-includes/class-wp-admin-bar.php +++ b/src/wp-includes/class-wp-admin-bar.php @@ -217,11 +217,7 @@ final protected function _get_node( $id ) { if ( empty( $id ) ) { $id = 'root'; } - - if ( isset( $this->nodes[ $id ] ) ) { - return $this->nodes[ $id ]; - } - return null; + return $this->nodes[ $id ] ?? null; } /** From 11410616632c117a7312c32adfc5bc5e6b4bf244 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20W=C3=BCnsch?= Date: Wed, 8 Apr 2026 09:29:10 +0200 Subject: [PATCH 2/2] Admin Bar: Simplify node retrieval using null coalescing operator --- src/wp-includes/class-wp-admin-bar.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wp-includes/class-wp-admin-bar.php b/src/wp-includes/class-wp-admin-bar.php index 5e7fed77d0d9d..0cf2cad3fcf24 100644 --- a/src/wp-includes/class-wp-admin-bar.php +++ b/src/wp-includes/class-wp-admin-bar.php @@ -217,6 +217,7 @@ final protected function _get_node( $id ) { if ( empty( $id ) ) { $id = 'root'; } + return $this->nodes[ $id ] ?? null; }