-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doc: Add documentation for ancestor
property in block metadata
#40027
Doc: Add documentation for ancestor
property in block metadata
#40027
Conversation
Adds documentation for the new API added in #39894
{ "ancestor": [ "my-block/product" ] } | ||
``` | ||
|
||
The `ancestor` property makes a block available inside the specified block types at any position of the ancestor block subtree. That allows, for example, to place a ‘Comment Content’ block inside a ‘Column’ block, as long as ‘Column’ is somewhere within a ‘Comment Template’ block. In comparrison to the `parent` property blocks that specify their `ancestor` can be placed anywhere in the subtree whilst blocks with a specified `parent` need to be direct children. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should double-check that, but I believe that the other difference with the parent
property is that ancestor
doesn't exclude other blocks from the inserter when inside the scope of the provided ancestors.
Co-authored-by: Greg Ziółkowski <[email protected]>
ancestor
propertyancestor
property in block metadata
@bph - this new API will require a dev note. |
I've noticed this section about |
Is there anything missing here? Can we land this PR? |
trac ticket: https://core.trac.wordpress.org/ticket/55531 |
Adds documentation for the new API added in #39894