Add WordPress hooks extractor workflow#310
Conversation
- Add extract-wp-hooks.yml workflow to auto-generate hooks documentation - Remove filters and hooks section from readme (now auto-generated to wiki)
There was a problem hiding this comment.
Pull request overview
This PR automates WordPress hooks documentation by adding a GitHub Actions workflow that extracts filters and hooks from PHP code and publishes them to the GitHub wiki. The workflow uses the akirk/extract-wp-hooks action and is triggered on pushes to trunk when PHP files change, or manually.
- Adds
.github/workflows/extract-wp-hooks.ymlworkflow for automatic hook extraction - Removes the manual "Filters and hooks" section from
readme.md(to be auto-generated) - Configures the workflow to extract hooks from the Micropub namespace and publish to the wiki
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/workflows/extract-wp-hooks.yml |
New workflow that automatically extracts WordPress hooks and filters documentation to the GitHub wiki using the extract-wp-hooks action |
readme.md |
Removes the manually maintained "Filters and hooks" section (67 lines) as this will now be auto-generated by the workflow |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -28,67 +28,6 @@ This project is placed in the public domain. You may also use it under the [CC0 | |||
|
|
|||
| ## WordPress details ## | |||
There was a problem hiding this comment.
The filters and hooks section was removed from readme.md, but the same section still exists in readme.txt (lines 31-88). Since both files appear to document the same WordPress plugin, they should be kept in sync. Consider removing the filters and hooks section from readme.txt as well, since the workflow will now auto-generate this documentation to the wiki.
| permissions: | ||
| contents: write | ||
| steps: | ||
| - uses: actions/checkout@v4 |
There was a problem hiding this comment.
This workflow uses actions/checkout@v4, while other workflows in the repository (deploy.yml and phpcs.yml) use actions/checkout@v6. For consistency and to ensure you're using the latest version with security fixes and improvements, consider updating to @v6.
| - uses: actions/checkout@v4 | |
| - uses: actions/checkout@v6 |
Document all Micropub hooks and filters for the extract-wp-hooks workflow: - before_micropub filter - after_micropub action - micropub_syndication action - micropub_syndicate-to filter - micropub_query filter - pre_insert_micropub_post filter - micropub_post_type filter - micropub_tax_input filter - micropub_post_content filter - micropub_suggest_title filter - micropub_dynamic_render filter
|
This one Iove... I should add this to all the projects I work on |
Summary
extract-wp-hooks.ymlworkflow using akirk/extract-wp-hooks actionThe workflow runs on push to trunk when PHP files change, or can be triggered manually.