Make WordPress Core

Opened 3 years ago

#60063 new enhancement

Add a dynamic hook to filter the pre-rendered content of a single block.

Reported by: gigitux Owned by:
Priority: normal Milestone: Awaiting Review
Component: Editor Version:
Severity: normal Keywords:
Cc: Focuses:

Description

Introducing a dynamic hook, pre_render_block_{$block_name}, as a complement to the already valuable pre_render_block hook could increase the developer experience. This new hook aims to filter the pre-rendered content for a specific block, eliminating the need for conditional statements within the pre_render_block filter callback. I searched on GitHub, and many folks use the pre_render_block and add a check to ensure the logic runs only for a specific block.

Some examples:

For the same reason, the render_block_{$block_name} hook has been implemented: https://core.trac.wordpress.org/ticket/46187.

I'm happy to work on it!

Change History (0)

Note: See TracTickets for help on using tickets.