How wordpress/gutenberg works
Gutenberg is the WordPress block-based editing and site-building project. The principal workflow is an author editing modular post content, with media processing and persistence through WordPress. Separate capabilities include site-wide theme styling and experimental real-time collaboration. The tree and README establish these product areas; sampled code supports the style-generation, global-styles REST, media-upload, and collaboration-storage roles, but does not establish every connection between editor screens and back-end services.
Main entry points: src Block editor · class-wp-theme-json-gutenberg.php Theme configuration · blocks.php Block integration · image-editor Media editing
Components 18
Content editing
- Block editor
packages/block-editor/src - Block integration
lib/blocks.php
Media handling
- Media editing
packages/media-editor/src/image-editor - Media REST API
lib/media/class-gutenberg-rest-attachments-controller.php
Site customization
- Site editor
lib/experimental/pages/site-editor.php - Global styles API
lib/class-wp-rest-global-styles-controller-gutenberg.php - Theme configuration
lib/class-wp-theme-json-gutenberg.php - Theme resolver
lib/class-wp-theme-json-resolver-gutenberg.php - Style engine
packages/style-engine/src/class-wp-style-engine.php
Collaboration
- Collaboration UI
packages/block-editor/src/components/collab - Collaboration REST
lib/experimental/collaboration/rest-api.php - Sync server
lib/experimental/collaboration/class-wp-sync-save-server.php - Sync storage
lib/experimental/collaboration/class-wp-sync-post-meta-storage.php
WordPress services
- Gutenberg plugin
gutenberg.php - Posts and pages
- WordPress media
- Theme styles
Other components
- Author
Connections 17
- Author → Block editor: edits content
- Block editor → Block integration: uses blocks
- Block integration → Posts and pages: persists content
- Block editor → Media editing: edits media
- Media editing → Media REST API: uploads media
- Media REST API → WordPress media: stores attachments
- Author → Site editor: customizes site
- Site editor → Global styles API: requests styles
- Global styles API → Theme configuration: parses configuration
- Theme configuration → Theme resolver: resolves theme data
- Theme configuration → Style engine: provides styles
- Style engine → Theme styles: generates CSS
- Author → Collaboration UI: collaborates
- Collaboration UI → Collaboration REST: syncs updates
- Collaboration REST → Sync server: dispatches sync
- Sync server → Sync storage: reads and writes
- Gutenberg plugin → Block editor: provides editor