[wp-trac] [WordPress Trac] #61738: admin_bar_menu node my-account returns null

WordPress Trac noreply at wordpress.org
Wed Jul 24 14:39:10 UTC 2024


#61738: admin_bar_menu node my-account returns null
--------------------------+---------------------
 Reporter:  michaelwp85   |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  6.6.2
Component:  Toolbar       |     Version:  6.6.1
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+---------------------

Comment (by joedolson):

 I'm inclined to agree with @pbiron, that the example code isn't the best
 way to do this. That said, the documentation for the action does
 specifically say that the hook is used to add, remove, or manipulate admin
 bar items, so it's reasonable that developers might be doing this.

 That said, I think it's pretty normal that any action needs to be added at
 a priority later than the code to be manipulated, so this is working as
 expected.

 It probably should have a dev note, but I don't feel it would be
 beneficial to revert. If we revert this change, then potentially a larger
 number of developers will choose to adjust their insertion priorities so
 that their menu items insert to the left of the user menu node. Leaving
 this in place just requires developers who are manipulating the user menu
 or the search nodes to change their priority levels, which I expect is a
 smaller number of cases.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61738#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list