Make WordPress Core

Opened 4 months ago

Closed 4 months ago

#65403 closed enhancement (fixed)

Code Quality: Admin Bar - Simplify node retrieval using null coalescing operator

Reported by: Soean Owned by: audrasjb
Priority: normal Milestone: 7.1
Component: Toolbar Version: 3.3
Severity: normal Keywords: has-patch commit
Cc: Focuses:

Description (last modified by sabernhardt)

WP_Admin_Bar->_get_node() returns an object or null since r62178. Now we can use the null coalescing operator and simplify the code.

Change History (7)

This ticket was mentioned in ​PR #11468 on ​WordPress/wordpress-develop by ​@Soean.


4 months ago
#1

  • Keywords has-patch added

WP_Admin_Bar->_get_node() returns an object or null since r62178. So we should use the null coalescing operator and simplify the code.

Trac ticket: https://core.trac.wordpress.org/ticket/65403

#2 @Soean
4 months ago

  • Type defect (bug) → enhancement

#3 @sabernhardt
4 months ago

  • Component General → Toolbar
  • Description modified (diff)
  • Milestone Awaiting Review → 7.1

#4 @mukesh27
4 months ago

  • Keywords commit added

Mark ready for commit

#5 @mukesh27
4 months ago

  • Version → 3.3

#6 @audrasjb
4 months ago

  • Owner set to audrasjb
  • Status new → accepted

Thanks! Self assigning for commit.

#7 @audrasjb
4 months ago

  • Resolution → fixed
  • Status accepted → closed

In 62460:

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.

Note: See TracTickets for help on using tickets.