[wp-trac] [WordPress Trac] #49442: Request: filter for parse_blocks() result

WordPress Trac noreply at wordpress.org
Thu Jun 12 09:17:02 UTC 2025


#49442: Request: filter for parse_blocks() result
---------------------------------------+---------------------
 Reporter:  dougwollison               |       Owner:  (none)
     Type:  feature request            |      Status:  new
 Priority:  normal                     |   Milestone:  6.9
Component:  General                    |     Version:  5.0
 Severity:  normal                     |  Resolution:
 Keywords:  has-patch needs-test-info  |     Focuses:
---------------------------------------+---------------------

Comment (by justlevine):

 Test cases for this are pretty simple, since we already test
 `render_block()` which directly uses this.

 Should be covered by using the filter to update a prop, and then checking
 the results of render_block to see if the rendered block reflects the
 changes from the filter, along with edge cases around someone providing a
 bad value to the filter, and comparing that the second param `$content` is
 the same as what's passed pre-parsing.

 As soon as I can figure out where in `phpunit/tests/blocks` this should
 live, I'll update the PR accordingly.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/49442#comment:20>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list