Replies: 1 comment
-
|
I read the RFC and it looks great 🚀 🚀 🚀 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Headless WordPress Webhooks RFC
Title: Webhooks for Headless WordPress
Author: Theo Despoudis
Status: Draft
Created: April 29, 2025
Last Updated: April 29, 2025
Introduction
This RFC proposes a standardized approach to implementing webhooks in WordPress, specifically designed to enhance headless WordPress architectures.
Problem Statement
Headless WordPress implementations currently lack a standardized, core-supported webhook system. This results in:
Goals
This RFC aims to:
Non-Goals
This RFC does not attempt to:
Proposed Solution
Core Components
Webhook Registration
Webhooks should be registrable via:
Management Interface
The admin UI should allow:
Standard Events
The following core WordPress events should trigger webhooks, building on the established hooks found in the Atlas Webhooks implementation:
Content Events
wp_insert_postpost_updateddeleted_posttrashed_postdraft_to_publishpublish_postcomment_postedit_commentdeleted_commenttrashed_commentadd_attachmentedited_termsUser Events
user_registerprofile_updatedelete_userwp_loginSystem Events
activated_plugindeactivated_pluginswitch_themeupdate_optionPayload Structure
All webhook payloads should follow a consistent structure:
{ "event": "post_updated", "timestamp": "2025-04-29T14:30:45Z", "webhook_id": 123, "webhook_name": "content_updated", "site_url": "https://example.com", "data": { "post": { "id": 123, "type": "post", "status": "publish", "title": "Post Title", "slug": "post-slug", "link": "https://example.com/post-slug", "modified": "2025-04-29T14:30:40Z", "content": "Post content (optional, configurable)", "excerpt": "Post excerpt (optional, configurable)", "meta": { "key1": "value1", "key2": "value2" } }, "user": { "id": 1, "name": "Admin User" }, "additional_context": { "referer": "edit page" } }, "delivery": { "id": "550e8400-e29b-41d4-a716-446655440000", "attempt": 1, "request_type": "POST" } }Extensibility
The webhook system should be extensible by:
Allowing plugins to register custom events
Providing filters to modify webhook payloads
Supporting custom authentication mechanisms
Enabling webhook middleware for transformations
Next Steps
After community feedback on this RFC:
Create a proof-of-concept implementation
Document the API for developers
Build example integrations with popular frontend frameworks (Next.js, Gatsby, Nuxt)
Reference Abstractions
Webhook Registration API
Event Dispatcher
Webhook Delivery System
Scheduler Abstraction
Beta Was this translation helpful? Give feedback.
All reactions