mirror of
git://develop.git.wordpress.org/
synced 2025-01-17 12:58:25 +01:00
b1121f1e7d
If a prospective hooked block has its `multiple` block-supports field set to `false` (thus allowing only one instance of the block to be present), ensure that: 1. Only one instance of the block will be inserted if it's not yet present in the current context. 2. The block will not be inserted at all if an instance of it is already present in the current context. As always in Block Hooks parlance, "context" denotes the containing template, template part, pattern, or navigation post that a hooked block is supposed to be inserted into. The markup of a webpage that uses a Block Theme typically comprises a number of such contexts -- one template and any number of template parts, patterns, and navigation posts. Note that the limitation imposed by this changeset only applies on a per-context basis, so it's still possible that the resulting page contains more than one instance of a hooked block with `"multiple": false` set, as each context could contribute up to one such instance. Props bernhard-reiter, jonsurrell, gziolo. Fixes #61902. git-svn-id: https://develop.svn.wordpress.org/trunk@59124 602fd350-edb4-49c9-b593-d223f7449a82