-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document WordPress filters and actions #45
Comments
Hi! Looks like I need to update the |
We developed https://github.com/pronamic/wp-documentor for this, see as output: https://github.com/wp-pay/core/blob/develop/docs/hooks.md. @helen maybe is https://github.com/pronamic/wp-documentor also something for 10up 😊? The advantages of https://github.com/pronamic/wp-documentor are that you do not have to add the |
WooCoomerce
WooCoomerce is using a PHP script to document their WordPress filters and actions:
https://github.com/woocommerce/code-reference/blob/0.7.0/generate-hook-docs.php
It extends https://www.phpdoc.org/ documentation by replacing the text
<!-- hooks -->
in the generated phpDocumentor output files: https://github.com/woocommerce/code-reference/blob/0.7.0/generate-hook-docs.php#L333.https://woocommerce.github.io/code-reference/
ApiGen
Before June 2019, WooCommerce used ApiGen:
https://github.com/woocommerce/woocommerce/pull/24003/files
The ApiGen documentation was removed somewhere between WooCommerce version
3.6.0
and3.7.0
: https://github.com/woocommerce/woocommerce/tree/3.6.0/apigen. This documentation was also extended with the hooks / actions information via a PHP script: https://github.com/woocommerce/woocommerce/blob/3.6.0/apigen/hook-docs.php. It also had a "Direct known implementers" and "Indirect known implementers" sections, which are not yet available in the phpDocumentor documentation: woocommerce/code-reference#11.WP Parser
The WordPress Code Reference on https://developer.wordpress.org/reference/ is generated using https://github.com/WordPress/phpdoc-parser, more information about this can be found at https://make.wordpress.org/docs/handbook/devhub/. This libary/plugin contains WP-CLI commands to export PHPDoc markup to JSON and convert it into WordPress posts, and insert into DB.
WordPress HookDoc
An alternative is to use https://github.com/matzeeable/wp-hookdoc which uses https://github.com/jsdoc/jsdoc.
GitHub Actions for WordPress
In https://github.com/10up/actions-wordpress#ideas the following idea is described:
This idea was added by @helen almost 2 years ago:
10up/actions-wordpress@556d7a6
Update April 4, 2021
This idea has already been realized, see:
https://github.com/10up/actions-wordpress/blob/stable/hookdocs-workflow.md
Example
Hookster
https://twitter.com/jasonbobich/status/987836700989669376
https://github.com/themeblvd/hookster
Yoast Parser
phpDox
https://phpdox.net/
Other Plugins
There are also many other plugins that have documentation for their filters and actions:
The text was updated successfully, but these errors were encountered: