WordPress.org

Make WordPress Core

Opened 18 months ago

Last modified 18 months ago

#22256 new enhancement

Hook namespaceing — at Initial Version

Reported by: scribu Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Plugins Keywords:
Focuses: Cc:

Description

We have a handy remove_action() function, but it works only if you can acquire the exact callback that was passed to add_action(), which is tricky when it comes to:

  • class instance methods, where you don't have access to the instance
  • PHP 5.3 closures

Introducing namespaces for hooks, similar to jQuery's namespaced events, we would not only take care of that problem, but also enable things like:

  • remove all callbacks to 'the_content' added by plugin X
  • remove all callbacks to the 'parse_query' action added by theme Y

Change History (0)

Note: See TracTickets for help on using tickets.