Pronamic WordPress Documentor is a tool to automatically extract data about the actions and filters of your WordPress theme or plugin.
To start documenting your WordPress filters and actions, require Pronamic WordPress Documentor in Composer:
composer require pronamic/wp-documentor --dev
To let Pronamic WordPress Documentor analyse your codebase, you have to use the parse
command and point it to the right directory:
vendor/bin/wp-documentor parse src
The format in which you want to export the hooks.
Format | Description |
---|---|
default |
Symfony console table. |
hookster |
Hookster JSON. |
markdown |
Markdown. |
phpdocumentor-rst |
RestructuredText for phpDocumentor. |
Example: --format=markdown
Custom PHP template, see for examples the templates
folder.
Example: --template=templates/markdown.php
Specify whether you want to export actions
or filters
.
Example: --type=actions
or --type=filters
Write output to file.
Example: --output=docs/hooks.md
Specifies the memory limit in the same format php.ini
accepts.
Example: --memory-limit=-1
Exclude the specified folders/files.
Example: --exclude=vendor --exclude=wordpress
If the search directory contains a .gitignore
file, you can reuse those rules to exclude files and directories from the results with this option.
Example: --ignore-vcs-ignored
Only parse hooks starting with the specified prefixes.
Example: --prefix=my_theme --prefix=my_plugin
vendor/bin/wp-documentor parse ./tests/source
vendor/bin/wp-documentor parse ./tests/source --format=hookster --type=actions --output=tests/docs/hookster-actions.json
vendor/bin/wp-documentor parse ./tests/source --format=hookster --type=filters --output=tests/docs/hookster-filters.json
vendor/bin/wp-documentor parse ./tests/source --format=markdown --output=tests/docs/hooks.md
vendor/bin/wp-documentor parse ./tests/source --format=phpdocumentor-rst --type=actions --output=tests/docs/phpdocumentor-actions.rst
vendor/bin/wp-documentor parse ./tests/source --format=phpdocumentor-rst --type=filters --output=tests/docs/phpdocumentor-filters.rst
- tests/docs/hooks.md
- tests/docs/hookster-actions.json
- tests/docs/hookster-filters.json
- https://github.com/wp-pay-gateways/omnikassa-2/blob/2.3.2/docs/hooks.md
- https://github.com/wp-pay-gateways/adyen/blob/1.3.1/docs/hooks.md
- https://github.com/wp-pay-gateways/mollie/blob/2.2.3/docs/hooks.md
- https://github.com/wp-pay-extensions/gravityforms/blob/2.6.0/docs/hooks.md
- https://github.com/wp-pay/core/blob/2.7.0/docs/hooks.md
Here is a list of alternatives that we found. However, none of these satisfied our requirements.
If you know other similar projects, feel free to edit this section!
- WP Parser by WordPress
- Hookster by Theme Blvd
- WordPress HookDoc by Matthias Günter
- GitHub Actions for WordPress by 10up
- Yoast Parser by Yoast
- WooCommerce Code Reference Generator by WooCommerce
- WordPress Hooks Reference by John Blackbourn / Human Made
- wp-hooks-generator by John Blackbourn / Human Made
Inspiration from https://github.com/TypistTech/imposter-plugin#alternatives
- https://developer.wordpress.org/plugins/hooks/
- https://developer.wordpress.org/plugins/hooks/actions/
- https://developer.wordpress.org/reference/functions/do_action/
- https://developer.wordpress.org/reference/functions/add_action/
- https://developer.wordpress.org/plugins/hooks/filters/
- https://developer.wordpress.org/reference/functions/apply_filters/
- https://developer.wordpress.org/reference/functions/add_filter/
- https://developer.wordpress.org/reference/hooks/
- https://www.phpdoc.org/
- https://github.com/phpdocumentor/phpdocumentor
- https://symfony.com/doc/current/console.html
- https://symfony.com/doc/current/components/finder.html
- https://developer.wordpress.org/cli/commands/i18n/make-pot/
- https://developer.wordpress.org/cli/commands/i18n/make-json/
- https://github.com/pronamic/deployer/blob/master/bin/pronamic-deployer
- https://gitlab.com/pronamic/wp-updates/-/blob/master/index.php
- pronamic/wp-pay-core#45
- phpDocumentor/phpDocumentor#2865
- https://github.com/themeblvd/hookster