Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Block Hooks: Expose serialized template content to filter.
The recently introduced Block Hooks API exposes a filter (`hooked_block_types`) which is given a `$context` argument, among others. If the filter is called on a block that's part of a template or template part, `$context` is set to the corresponding `WP_Block_Template` object. However, that object's `$content` property is currently ''not'' exposed to the filter. This changeset amends that shortcoming. This is useful for callbacks that might want to detect the presence of a serialized block instance (or potentially in the future utilize the HTML API) to restrict where the block is injected (before the template is rendered). Addressing this also achieves parity with the structure of `$context` when it represents a pattern (where pattern serialized content is present). Merges [57118] to the 6.4 branch. Props nerrad. Fixes #59882. git-svn-id: https://develop.svn.wordpress.org/branches/6.4@57119 602fd350-edb4-49c9-b593-d223f7449a82
- Loading branch information