Skip to content

feat: blocks as stable JSON (0.5) - #14

Merged
ogorzalka merged 1 commit into
mainfrom
feat/0.5-blocks
Nov 24, 2026
Merged

ogorzalka merged 1 commit into
mainfrom
feat/0.5-blocks

Conversation

@ogorzalka

Copy link
Copy Markdown
Member

Last slice of 0.5. The field headless_blocks of a post (when _fields names it): the blocks with the same keys on every block, in the same order — id (position, 1.0 is the first block inside the second), name, attributes (comment attributes completed with the block type's defaults, {} when none), html (own HTML), rendered (what WordPress prints; top-level and dynamic blocks), inner_blocks.

  • Classic content is one core/freeform block; whitespace between blocks is dropped; a post with a password gives null.
  • Computed only when asked for (WordPress would compute every registered field otherwise).
  • Not in the preview answer (documented).
  • Unit tests and integration tests (real parser, real block types, a real dynamic block inside a group).

BlockTree and the headless_blocks field of a post (when _fields names it): the same keys on every block (id, name, attributes completed with the defaults of the block type, html, rendered, inner_blocks), rendered on top-level and dynamic blocks, classic content as a freeform block, nothing for a post with a password.
@ogorzalka ogorzalka added the api-change The public surface (hooks, config keys, commands) changes label Nov 24, 2026
@ogorzalka
ogorzalka merged commit 7ed0e4f into main Nov 24, 2026
11 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-change The public surface (hooks, config keys, commands) changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant