[wp-trac] [WordPress Trac] #61738: admin_bar_menu node my-account returns null
WordPress Trac
noreply at wordpress.org
Mon Aug 12 08:44:39 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: needs-patch needs-dev-note | Focuses:
----------------------------------------+---------------------
Comment (by michaelwp85):
I can confirm switching to the `wp_before_admin_bar_render` hook resolves
my issue.
Changes needed in my scenario:
- change hook
- remove `$wp_admin_bar` from the callback (this is not available in the
`wp_before_admin_bar_render` hook)
- update callback return type to `:void`
- Add global var
{{{#!php
<?php
/** @var \WP_Admin_Bar $wp_admin_bar */
global $wp_admin_bar;
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/61738#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list