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

Lock all blocks we know we don't want anyone to edit #19

Closed
knice opened this issue Apr 12, 2022 · 1 comment
Closed

Lock all blocks we know we don't want anyone to edit #19

knice opened this issue Apr 12, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@knice
Copy link
Member

knice commented Apr 12, 2022

With the new ability to lock blocks in the site editor, we should lock all of the blocks we know we don't want anyone to modify.

This code disables moving or removing blocks when you add it to the block code in the theme.

"lock":{"move":true,"remove":true}

Here's an example used in a block:

<!-- wp:template-part {"slug":"header-global","theme":"theme-ucsc","lock":{"move":true,"remove":true}} /-->
@knice knice added the enhancement New feature or request label Apr 12, 2022
@knice knice self-assigned this May 2, 2022
@knice
Copy link
Member Author

knice commented Jul 21, 2022

WordPress 6.0 has proper API hooks and filters to set access/permissions for block locking.

https://developer.wordpress.org/block-editor/how-to-guides/curating-the-editor-experience/

You can also limited access to the code editor.

knice added a commit that referenced this issue Aug 17, 2022
@knice knice closed this as completed in 6c8d619 Aug 17, 2022
@knice knice added this to the Pilot Partner Launch milestone Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant