Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Block Hooks: Fix context in
update_ignored_hooked_blocks_postmeta
.
Ensure that the `$context` arg passed from `update_ignored_hooked_blocks_postmeta` to `apply_block_hooks_to_content` (and from there, to filters such as `hooked_block_types` and `hooked_block`) has the correct type (`WP_Post`). Filters hooked to `hooked_block_types` etc can typically include checks that conditionally insert a hooked block depending on `$context`. Prior to this changeset, a check like `if ( $context instanceof WP_Post )` would incorrectly fail, as `$context` would be a `stdClass` instance rather than a `WP_Post`. As a consequence, a hooked block inside of a Navigation post object that was modified by the user would not be marked as ignored by `update_ignored_hooked_blocks_postmeta`, and thus be erroneosly re-inserted by the Block Hooks algorithm. Props bernhard-reiter. Fixes #62639. git-svn-id: https://develop.svn.wordpress.org/trunk@59482 602fd350-edb4-49c9-b593-d223f7449a82
- Loading branch information