Ticket #15723 (closed feature request: fixed)

Opened 18 months ago

Last modified 18 months ago

admin_bar_menu Hook Pass Back Admin Bar Instance

Reported by: TheDeadMedic 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

15723.diff Download (415 bytes) - added by JohnPBloch 18 months ago.

Change History

  • Milestone changed from Awaiting Review to 3.1

Would this still work if the callback doesn't take an arg?

  • 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()).

  • Status changed from new to closed
  • Resolution set to fixed

(In [16957]) Pass wp_admin_bar object to admin_bar_menu action. Props TheDeadMedic, JohnPBloch. fixes #15723

Note: See TracTickets for help on using tickets.