Opened 3 years ago
Closed 3 years ago
#15723 closed feature request (fixed)
admin_bar_menu Hook Pass Back Admin Bar Instance
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.1 |
| Component: | Menus | Version: | 3.1 |
| Severity: | minor | Keywords: | has-patch |
| Cc: |
Description
Would it not be handy to pass back the instance $wp_admin_bar in the do_action() call, if anything to save a lot of global calls?
do_action_ref_array( 'admin_bar_menu', array(&$wp_admin_bar) );
Attachments (1)
Change History (5)
JohnPBloch
— 3 years ago
comment:3
JohnPBloch
— 3 years ago
- Keywords has-patch added
Using do_action_ref_array() as TheDeadMedic suggested works fine. If the callback doesn't take an argument this will still work (and the object will still be accessible by using func_get_args()).
Note: See
TracTickets for help on using
tickets.
Would this still work if the callback doesn't take an arg?