[wp-trac] [WordPress Trac] #49387: Run pre_render_block filter in block-renderer REST controller

WordPress Trac noreply at wordpress.org
Sat Feb 8 22:16:07 UTC 2020

#49387: Run pre_render_block filter in block-renderer REST controller
 Reporter:  kadamwhite    |      Owner:  kadamwhite
     Type:  defect (bug)  |     Status:  assigned
 Priority:  normal        |  Milestone:  5.4
Component:  Editor        |    Version:  5.1
 Severity:  normal        |   Keywords:  needs-patch
  Focuses:                |
 Since 5.1, the `render_block` method in `wp-includes/blocks.php` calls the
 `pre_render_block` filter and short-circuits block rendering if that
 filter returns a value. This can be used to implement alternative block
 rendering systems, but the filter is not called when rendering a block via
 the `/block-renderer` API endpoints. This leads the rendered preview of
 the blocks in the editor to differ from the frontend if these filters are
 in use.

 I discussed this briefly with @aduth
 [https://wordpress.slack.com/archives/C02QB2JS7/p1580926715433500|in the
 #core-editor slack channel], and we agreed it seemed like an unintentional
 omission. If code on the site is going to change the output of a block on
 the frontend, that output should be visible in the ServerSideRender
 component's output.

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

More information about the wp-trac mailing list