[wp-trac] [WordPress Trac] #63580: render_block does not render innerblocks when used explicitly

WordPress Trac noreply at wordpress.org
Tue Jun 17 08:46:33 UTC 2025


#63580: render_block does not render innerblocks when used explicitly
--------------------------+-----------------------------
 Reporter:  yashjawale    |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Editor        |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:  template      |
--------------------------+-----------------------------
 When using render_blocks explicitly, it doesn't render the nested blocks
 if they don't have any innerContent defined in them.

 I believe this shouldn't be the case as some parent blocks like
 core/column shouldn't won't necessarily have innerContent when other
 blocks are present inside them.

 For example, this doesn't render the content of the nested paragraph
 blocks

 {{{#!php
 <?php
 $first_column_blocks = [
         [
                 'blockName' => 'core/paragraph',
                 'attrs' => [],
                 'innerBlocks' => [],
                 'innerHTML' => '<p>This is the first column demo
 content.</p>',
                 'innerContent' => [
                         '<p>This is the first column demo content.</p>',
                 ],
         ],
 ];

 $second_column_blocks = [
         [
                 'blockName' => 'core/paragraph',
                 'attrs' => [],
                 'innerBlocks' => [],
                 'innerHTML' => '<p>This is the second column demo
 content.</p>',
                 'innerContent' => [
                         '<p>This is the second column demo content.</p>',
                 ],
         ],
 ];

 $column_layout_block = [
         'blockName' => 'core/columns',
         'attrs' => [],
         'innerBlocks' => [
                 [
                         'blockName' => 'core/column',
                         'attrs' => [],
                         'innerBlocks' => $first_column_blocks
                 ],
                 [
                         'blockName' => 'core/column',
                         'attrs' => [],
                         'innerBlocks' => $second_column_blocks
                 ],
         ]
 ];
 }}}

 For markup generated by Gutenberg, there is some innerContent generated
 hence, it doesn't the same issue. But I don't think a developer is
 expected to pass this content in explicitly [demonstrated in linked image]

 More info present in Gutenberg ticket linked below

 ----

 This issue was originally reported by Andreas Lindahl as an Issue on
 Gutenberg repository
 https://github.com/WordPress/gutenberg/issues/69307

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


More information about the wp-trac mailing list