[wp-trac] [WordPress Trac] #56417: Changes from 'render_block_data' filter not always applied to inner blocks

WordPress Trac noreply at wordpress.org
Tue Aug 23 08:20:40 UTC 2022


#56417: Changes from 'render_block_data' filter not always applied to inner blocks
---------------------------+-----------------------------
 Reporter:  isabel_brison  |      Owner:  (none)
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Editor         |    Version:
 Severity:  normal         |   Keywords:
  Focuses:                 |
---------------------------+-----------------------------
 When changes are made to `$parsed_block['innerContent']` using the
 'render_block_data' filter, those changes are only applied to top-level
 blocks, not to inner blocks.

 The issue is how we deal with inner blocks in `class WP_Block`'s render
 method: we don't create a new instance between applying the filter and
 calling render on the inner block[https://github.com/WordPress/wordpress-
 develop/blob/trunk/src/wp-includes/class-wp-block.php#L241], so changes to
 `innerContent` aren't actually applied.

 Ideally we should apply the same logic here as we do in the `render_block`
 function: [https://github.com/WordPress/wordpress-develop/blob/trunk/src
 /wp-includes/blocks.php#L903].

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


More information about the wp-trac mailing list