Skip to content

Commit c1163e7

Browse files
committed
Code Modernization: Simplify node retrieval using null coalescing operator.
This changeset makes a small code readability improvement in the `_get_node()` function inside the `WP_Admin_Bar` class. Props Soean, mukesh27. Fixes #65403. git-svn-id: https://develop.svn.wordpress.org/trunk@62460 602fd350-edb4-49c9-b593-d223f7449a82
1 parent a6a1aad commit c1163e7

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/wp-includes/class-wp-admin-bar.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,7 @@ final protected function _get_node( $id ) {
218218
$id = 'root';
219219
}
220220

221-
if ( isset( $this->nodes[ $id ] ) ) {
222-
return $this->nodes[ $id ];
223-
}
224-
return null;
221+
return $this->nodes[ $id ] ?? null;
225222
}
226223

227224
/**

0 commit comments

Comments
 (0)