Make WordPress Core

Opened 19 years ago

Closed 18 years ago

#1579 closed defect (bug) (wontfix)

Way to tell what hooks are supported

Reported by: markjaquith's profile markjaquith Owned by: markjaquith's profile markjaquith
Milestone: Priority: normal
Severity: normal Version:
Component: Administration Keywords: has-patch 2nd-opinion dev-feedback
Focuses: Cc:


As hooks are added, and people write plugins to support them, sometimes it can be tricky, figuring out what hooks were added when, and doing version comparisons to figure out if the hook is going to work.

This patch adds an array of all the hooks and filters I could find. It also adds the dynamic option_ and pre_option_ hooks as well as the *_template ones. That should pretty much cover it except for the dynamic admin menu stuff which is kind of making me crosseyed, and doesn't really matter for this purpose.

There is also a function: hook_exists('hook_name'); It returns true or false.

Hooks are stored in the $wp_hooks array, which is set in vars.php (I thought this was appropriate.

Obviously, hooks aren't going to add themselves to this list, so we'll need to make sure to add to this list as we add hooks! I don't think this will be a problem.

Please feel free to look over the code and see if I misspelled anything or missed any hooks.

Attachments (1)

vars.php.diff (4.2 KB) - added by markjaquith 19 years ago.
Patch for /branches/1.5/

Download all attachments as: .zip

Change History (5)

19 years ago

Patch for /branches/1.5/

#1 @markjaquith
19 years ago

  • Status changed from new to assigned

#2 @ringmaster
19 years ago

This seems useful. WordPress could do a bit more with reflection-like functions such as this.

#3 @foolswisdom
18 years ago

  • Keywords has-patch 2nd-opinion dev-feedback added; bg|has-patch bg|2nd-opinion bg|dev-feedback removed

Hi Mark, is this bug still relevant? If it is, does the patch need updating?

It has not been updated in a year and currently targets milestone 1.5.1 .

#4 @markjaquith
18 years ago

  • Milestone 1.5.1 deleted
  • Resolution set to wontfix
  • Status changed from assigned to closed

There was some interest, as I recall, but my creation of the WordPress Hooks Database has somewhat lessened its importance, so I'm willing to close it. As always, if someone has a good argument for it, feel free to make your case here.

Note: See TracTickets for help on using tickets.