[wp-trac] [WordPress Trac] #46187: Add a dynamic hook to filter the content of a single block.
WordPress Trac
noreply at wordpress.org
Tue Nov 24 04:32:53 UTC 2020
#46187: Add a dynamic hook to filter the content of a single block.
-----------------------------+------------------------------
Reporter: manzoorwani.jk | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Editor | Version:
Severity: normal | Resolution:
Keywords: has-patch close | Focuses:
-----------------------------+------------------------------
Comment (by noisysocks):
Yes, `/` is a valid character in an array index but it doesn't fit with
the WordPress naming conventions for filters.
https://make.wordpress.org/core/handbook/best-practices/coding-
standards/php/#naming-conventions
Another problem if we do this is that it will not be intuitive which
filter (`render_block` vs `render_block_$block`) is called first. It will
also not be possible for developers to use the `$priority` param in
`add_filter` to e.g. make their `render_block_$block` filter fire before
or after another plugin's `render_block` filter.
I don't personally think that the convenience is worth the added
ambiguity.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/46187#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list