[wp-trac] [WordPress Trac] #59551: Respect non-null values from the `pre_render_block` filter

WordPress Trac noreply at wordpress.org
Thu Oct 5 20:52:13 UTC 2023


#59551: Respect non-null values from the `pre_render_block` filter
--------------------------+------------------------------
 Reporter:  danieliser    |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by dmsnell):

 @danieliser for more context here, and thank you @pbiron for sharing
 above, this filter performs a kind of inverted goal to most filters. it's
 only wanting to know if the rendering process should be circumvented, and
 so there's an ambiguity if it returns content. with `null` it's clear that
 some filter took care of it and so the process can abort.

 the original block is passed as a second argument to the filter, so it's
 still possible to inspect what was there before, but if some plugin
 removes a block from the rendering stage, there's nothing left to filter
 after that point.

 are you trying to avoid some enqueued styles?

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


More information about the wp-trac mailing list