WordPress 6.0 To Ship New Block Locking Feature

WordPress 6.0 To Ship New Block Locking Feature

Posted by WP Tavern on May 9, 2022 at 10:16 pm
kitty kitty CATegory News
WordPress 6.0 has several new features that should make any extender happy about building on top of the platform. However, one of the more advanced tools is the ability to lock blocks, which can be used to prevent specific blocks from being moved or removed. The upcoming release includes a new “Lock” setting in the block toolbar’s options dropdown, as shown in the following screenshot: Selecting the Lock option from the block toolbar. Once clicking the lock option, a modal appears that allows the user to disable movement of the block or prevent its removal: Block locking options. Thus far, the best use case I have found for locking blocks via the UI is to stop accidental edits. Because users have access to the UI settings by default, they can disable the lock later if I need to move something around the layout or delete it. On the surface, this may not seem like a particularly robust feature. However, the real power of block locking is on the development end. Theme authors can use the new lock key to prevent end-users from moving or removing specific blocks in their templates. The following code is an example of a Group block…

…Full post on WP Tavern
Read Full

Similar Posts

Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments