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

WordPress Trac noreply at wordpress.org
Wed Jul 24 14:05:33 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 pbiron):

 I would argue that calling `$wp_admin_bar->get_node()` in a function
 hooked to `admin_bar_menu` is `_doing_it_wrong()`.

 @rabmalin A much more appropriate hook to use would be
 [https://developer.wordpress.org/reference/hooks/wp_before_admin_bar_render/
 wp_before_admin_bar_rende].  As it says in the DocBlock of that hook:

 > The wp_before_admin_bar_render action allows developers to modify the
 $wp_admin_bar object before it is used to render the Toolbar to the
 screen.

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


More information about the wp-trac mailing list