dimanche 4 octobre 2015

Is there a script or plugin to generate hook references?

It seems a lot of plugin developers take the time to add filter/action hooks to let users tweak their products’ functionality. Which is great, but what they often don’t do is provide a list of hooks and how many arguments they take. Has anyone found the best automated way to point at a plugin (or theme) directory and see a list of all available hooks?

I’ve seem some plugins that scan for hooks, but as far as I can tell, they show you which ones are actually being called to render a given page. Which I get can be handy. But sometimes if I know I’m interacting with a particular plugin, I want to know every place it might let me hook an action or filter. So what I’m really looking for is something that, given a plugin root directory will create a list where each item includes:

  • tag
  • type (action or filter)
  • number of arguments
  • where it’s called (via do_action() or apply_filter()) in the source

A plugin would be great since this could presumably nicely HTMLify the whole thing and show it to me right in the admin UI for every plugin. But even a command-line script that outputs a useful static file would be great.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire