-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
When locking a container block, offer option to lock all blocks within #40069
Comments
It is already doable using the More details can be found in the dev note - https://make.wordpress.org/core/2022/01/08/locking-blocks-in-wordpress-5-9/#working-alongside-templatelock. Edit: I watched the "Product Walk-Through" video, so now I've more context 😄 My question now is if we want to use |
I think the simplest option from a UX point of view might be to directly apply the lock attribute to each inner block so that the lock icon is visible in the inner block toolbars, but make it so that you can't access the modal from the inner blocks when the option is applied on the container. The UI could look like this, with an extra toggle at the bottom of the modal to "apply to inner blocks:" It might make sense to hide the toggle when no options are selected. Also the “apply to inner blocks” option isn't really applicable when “restrict editing” is selected for the Reusable block (as being explored in #39950) so maybe the toggle could be hidden if that's the only option selected as well 🤔 |
It is a good idea with a toggle to give the option to hide the inner blocks. |
To ground this work in some great user insights, here's some feedback from the thirteenth call for testing for the FSE Outreach program that touches on this exact scenario:
|
I agree. This means if one locks a parent container that everything inside the container should automatically also become locked. |
This one is tricky! In general I agree that locking a container should also lock the children by default. But this raises a couple of questions:
Side note: We might need a visual treatment in List View to communicate child lock status as well, Figma uses a dot aligned with the parent lock icon, which might work here? |
What problem does this address?
Currently, when locking blocks, the locking only applies to the block in question. However, in some cases, like a Group block, you might want to lock all blocks within it too. The only way to do this is to lock each block individually. This came up during the 6.0 walkthrough.
What is your proposed solution?
Provide a way to cascade locking properties down to the blocks within a container block. This would be slightly different from locking a reusable block, in that you can still edit the contents, you just can't move/delete the items inside. Perhaps one approach would be to offer a toggle inside the locking modal saying: "apply to all blocks inside".
cc @Mamaduka @critterverse
The text was updated successfully, but these errors were encountered: