[wp-trac] [WordPress Trac] #64505: REST API: Block renderer passes incomplete block shape

WordPress Trac noreply at wordpress.org
Thu Jan 15 04:50:14 UTC 2026


#64505: REST API: Block renderer passes incomplete block shape
--------------------------+-----------------------------
 Reporter:  dlh           |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  REST API      |    Version:  5.4
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Since [47360], the `WP_REST_Block_Renderer_Controller::get_item()` method
 creates "an array representation simulating the output of parse_blocks"
 and passes it to `render_block()`, but the array is missing the
 `innerBlocks` key.

 This missing key causes issues with downstream code that either treats a
 block without `innerBlocks` as invalid input or, more commonly, assumes
 that `innerBlocks` is present and accesses it unconditionally
 ([https://github.com/WordPress/wordpress-
 develop/blob/5ed1e083f0d3e5207bf467e20845129a20fb3c31/src/wp-
 includes/blocks.php#L2241 example]).

 Instead of manually constructing an array, one can be created from a
 `WP_Block_Parser_Block`, as proposed in the linked PR, which will provide
 higher fidelity to the shape returned by `parse_blocks()`.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64505>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list