Skip to content

Add WordPress hooks extractor workflow#310

Merged
pfefferle merged 2 commits intotrunkfrom
add-hooks-extractor
Jan 3, 2026
Merged

Add WordPress hooks extractor workflow#310
pfefferle merged 2 commits intotrunkfrom
add-hooks-extractor

Conversation

@pfefferle
Copy link
Member

Summary

  • Add extract-wp-hooks.yml workflow using akirk/extract-wp-hooks action
  • Automatically extracts filters and hooks documentation to the GitHub wiki
  • Remove filters and hooks section from readme (now auto-generated)

The workflow runs on push to trunk when PHP files change, or can be triggered manually.

- Add extract-wp-hooks.yml workflow to auto-generate hooks documentation
- Remove filters and hooks section from readme (now auto-generated to wiki)
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.yml workflow 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 ##
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
permissions:
contents: write
steps:
- uses: actions/checkout@v4
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
- uses: actions/checkout@v4
- uses: actions/checkout@v6

Copilot uses AI. Check for mistakes.
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
@pfefferle pfefferle merged commit 58e14fb into trunk Jan 3, 2026
10 checks passed
@dshanske
Copy link
Member

dshanske commented Jan 3, 2026

This one Iove... I should add this to all the projects I work on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants