Skip to content
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

Documentation: Clarify the behavior of parent when empty during block registration #15731

Open
ellatrix opened this issue May 20, 2019 · 2 comments
Labels
[Feature] Block API API that allows to express the block paradigm. Good First Issue An issue that's suitable for someone looking to contribute for the first time Needs Dev Ready for, and needs developer efforts [Type] Developer Documentation Documentation for developers

Comments

@ellatrix
Copy link
Member

ellatrix commented May 20, 2019

Part of #41236.

Describe the bug

https://developer.wordpress.org/block-editor/developers/block-api/block-registration/#parent-optional

It might be good to update the documentation here to clarify that you can restrict it to the root if you pass an empty array. (Also good to check if there are tests for this or if it just happens to work.)

This also leads to the question what the default is for this parameter. undefined? null? In any case just "Type: Array" doesn't seem correct.

@ellatrix ellatrix added [Feature] Block API API that allows to express the block paradigm. [Type] Developer Documentation Documentation for developers Good First Issue An issue that's suitable for someone looking to contribute for the first time labels May 20, 2019
@gziolo gziolo added the Needs Dev Ready for, and needs developer efforts label Oct 21, 2019
@cguntur
Copy link

cguntur commented Oct 16, 2020

@annezazu I would like to take this up but, I have a question. When I create a new block using inner blocks and set the parent to core/group, I can see that block when I want to add blocks to a group block, but otherwise I don't see it.

When I set the parent to an empty array [], I don't see the block at all in the editor. Am I missing something here?

Also, looks like the parent option only works when we use inner blocks. Is that correct?

I am just testing to make sure I am able to see the correct result before modifying the documentation.

@annezazu
Copy link
Contributor

Amazing! Thanks for stepping in here @cguntur <3 @mkaz might you be able to help answer the above?

@gziolo gziolo changed the title Documentation: Block Registration: parent can be empty Documentation: Clarify the behavior of parent when empty Feb 26, 2023
@gziolo gziolo changed the title Documentation: Clarify the behavior of parent when empty Documentation: Clarify the behavior of parent when empty during block registration Feb 26, 2023
@gziolo gziolo mentioned this issue Feb 26, 2023
58 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block API API that allows to express the block paradigm. Good First Issue An issue that's suitable for someone looking to contribute for the first time Needs Dev Ready for, and needs developer efforts [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

No branches or pull requests

4 participants