Skip to content

Generate a list of hooks used in your plugin or theme.

Notifications You must be signed in to change notification settings

iconicwp/wordpress-list-hooks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

WordPress List Hooks

Generate a list of hooks used in your plugin or theme.

How to use

  1. Let's assume your plugin resides in wp-content/plugins/example-plugin. Create a folder named tasks at this path: wp-content/plugins/example-plugin/tasks. You can do the same for themes.
  2. Add list-hooks.sh to the tasks folder.
  3. Open list-hooks.sh and modify the config parameters.
    1. Change hookPrefix to the prefix you use for your actions and filters.
    2. Change output to modify where the hooks.txt file is created. Leave it as it is to generate it in the tasks folder.
    3. Change exclude to ensure certain fodlers are not included in the search for hooks.
  4. Navigate to the tasks folder in terminal.
  5. Type bash list-hooks.sh into terminal and press enter.
  6. A file named hooks.txt will be generated in your tasks folder.

Requirements

  • This script uses ggrep which you can install using homebrew.
  • This script was built for use on a Mac, not sure how well it works on Windows.

Example

Here's a doc for my WooCommerce Delivery Slots plugin which I used this script on.

Contribute

See anything that could be better? Submit an issue, or even better, a PR!

About

Generate a list of hooks used in your plugin or theme.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages