wordpress-develop/tests
bernhard-reiter a92aa29daf Block Hooks: Introduce a new hooked_block_{$block_type} filter.
Add a new `hooked_block_{$block_type}` filter that allows modifying a hooked block (in parsed block format) prior to insertion, while providing read access to its anchor block (in the same format).

This allows block authors to e.g. set a hooked block's attributes, or its inner blocks; the filter can peruse information about the anchor block when doing so. As such, this filter provides a solution to both #59572 and #60126.

The new filter is designed to strike a good balance and separation of concerns with regard to the existing [https://developer.wordpress.org/reference/hooks/hooked_block_types/ `hooked_block_types` filter], which allows addition or removal of a block to the list of hooked blocks for a given anchor block -- all of which are identified only by their block ''types''. This new filter, on the other hand, only applies to ''one'' hooked block at a time, and allows modifying the entire (parsed) hooked block; it also gives (read) access to the parsed anchor block.

Props gziolo, tomjcafferkey, andrewserong, isabel_brison, timbroddin, yansern.
Fixes #59572, #60126.

git-svn-id: https://develop.svn.wordpress.org/trunk@57354 602fd350-edb4-49c9-b593-d223f7449a82
2024-01-25 13:46:49 +00:00
..
e2e Options, Meta APIs: Prevent saving of invalid timezones. 2023-10-16 23:49:10 +00:00
gutenberg Block Editor: Update the Gutenberg branch used to launch Gutenberg e2e tests. 2021-06-01 09:21:36 +00:00
performance Build/Test Tools: Expand performance test scenarios. 2023-11-08 10:30:21 +00:00
phpunit Block Hooks: Introduce a new hooked_block_{$block_type} filter. 2024-01-25 13:46:49 +00:00
qunit Taxonomy: Set "public" to "false" for user pattern categories. 2023-11-01 14:48:50 +00:00
visual-regression Build/Test Tools: Migrate Puppeteer tests to Playwright. 2023-10-13 08:11:41 +00:00