[wp-trac] [WordPress Trac] #49442: Request: filter for parse_blocks() result
WordPress Trac
noreply at wordpress.org
Wed Jan 1 09:10:03 UTC 2025
#49442: Request: filter for parse_blocks() result
-----------------------------+-----------------------------
Reporter: dougwollison | Owner: (none)
Type: feature request | Status: new
Priority: normal | Milestone: Future Release
Component: General | Version: 5.0
Severity: normal | Resolution:
Keywords: | Focuses:
-----------------------------+-----------------------------
Comment (by justlevine):
Dusting this off after 5 years.
While replacing the `block_parser_class` is suitable when you "need to
heavily customize the block parsing", it's a very uncomfortable DX.
In support, we need look no further than the overreliance of the
`render_block`/`render_block_data` hook for Block Supports and the
resulting headaches when trying to work with that data in PHP, implement
caching, using over REST/GraphQL or otherwise outside the template canvas,
etc.
The attached diff is still valid all this time later, though I think we
should pass the original `$content` as well, since that's a safer target
than whatever the results of a filtered `block_parser_class` may be.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49442#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list