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

Add option for fully locking a block #51968

Open
mtias opened this issue Jun 27, 2023 · 7 comments
Open

Add option for fully locking a block #51968

mtias opened this issue Jun 27, 2023 · 7 comments
Labels
[Feature] Block Locking The API allowing for the ability to lock/unlock blocks [Type] Task Issues or PRs that have been broken down into an individual action to take

Comments

@mtias
Copy link
Member

mtias commented Jun 27, 2023

Currently, the locking options are all about selectively restricting some block interactions. "Content only" introduced a little while back started dealing with the editing of blocks. We are lacking an option to fully lock down a block so that no edits are possible.

@mtias mtias added [Type] Task Issues or PRs that have been broken down into an individual action to take [Feature] Block Locking The API allowing for the ability to lock/unlock blocks labels Jun 27, 2023
@richtabor
Copy link
Member

"Content only" introduced a little while back started dealing with the editing of blocks.

We also don't have a UI for content only.

@annezazu
Copy link
Contributor

Related on the theme author front: #36008

@bradhogan
Copy link

+1

@fabiankaegy
Copy link
Member

Isn't this solved by useBlockEditingMode('disabled') ? The disabled mode removes the block from the list view and makes it completely inert?

@bradhogan
Copy link

@fabiankaegy This isn't about disabling the option to use a block it's about adding a block with content and disabling the option for that content to be changed.

@fabiankaegy
Copy link
Member

@bradhogan Yeah, I get that. I think that exactly is possible with this.

A block can programmatically get its editing mode set to disabled at which point you can no longer interact with the block. It sill exists and it still outputs everything that was set in it. But it cannot be changed anymore until it gets unlocked 🤔

@bradhogan
Copy link

@fabiankaegy Ok got it. So you're saying this could potentially be implemented in core (or Gutenberg) relatively easily since the option is essentially already there. 🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block Locking The API allowing for the ability to lock/unlock blocks [Type] Task Issues or PRs that have been broken down into an individual action to take
Projects
None yet
Development

No branches or pull requests

5 participants