Block Accidental Edits of Shared Content With the Lock Reusable Blocks Plugin – WP Tavern

Over the weekend, internet developer Marie Comet launched the Lock Reusable Blocks plugin. Since then, she has revealed a few extra updates that polish that preliminary launch. The extension blocks customers from immediately enhancing reusable blocks from the post-editing display screen.

Reusable blocks permit customers to group a number of blocks within the submit editor, save them, and reuse anyplace blocks are supported. Technically, they’re “shared” or “synced.” If enhancing a reusable block in a single location, all makes use of of it is going to share these adjustments.

WordPress post editor with a group of blocks selected. The button for adding a reusable block has been selected, and a popup is on the screen for naming it.
Making a reusable block.

The issue with the characteristic is that it’s not at all times clear if you find yourself enhancing a reusable block. WordPress will show its identify within the toolbar, checklist view, and breadcrumbs nav. Nevertheless, the one clear message that it’s a shared occasion is within the sidebar panel, which solely seems if open.

Earlier than WordPress 5.7, customers needed to click on an “Edit” button to make adjustments to a reusable block. No less than in that state of affairs, it was considerably clear that the content material was totally different from the primary submit or web page content material. Nevertheless, 5.7 rolled out a “click-through” technique for enhancing. The primary click on selects the wrapper component across the saved block, requiring a second click on to edit any interior content material. This variation has made it far too simple to inadvertently edit world content material.

I’m acquainted sufficient with the editor that I doubt I’d slip up with this drawback. Nevertheless, I nonetheless hand websites over to family and friends on occasion. Most by no means uncover the characteristic, however those that do inevitably make these world adjustments when they didn’t intend to. I’ve additionally heard sufficient client-related horror tales from others to know it’s a official subject.

There’s an open ticket to bring a locking mechanism to reusable blocks, and there was a patch for it since June 2021. Nevertheless, there has not been a lot motion within the final a number of months. Within the meantime, at the least we have now the Lock Reusable Blocks plugin.

Comet’s resolution takes a special strategy from earlier variations of WordPress and the proposed patch. As a substitute of giving customers the choice to edit in-content, they’re blocked from doing so altogether:

Reusable block in the post editor grayed out with two buttons at the top.  One is for editing the block.  The other is for converting the block.
Lock Reusable Blocks overlay and buttons.

The plugin grays out the reusable block and provides two buttons excessive when chosen within the editor. The primary button permits enhancing, but it surely does so by opening a brand new browser tab/window and taking the consumer to the editor for the block itself. This strategy makes it clear that the content material is separate from the submit.

WordPress’s reusable block administration display screen is hidden by default, however there are just a few plugins that enable it.

The plugin’s second button within the overlay permits customers to transform the reusable block to common blocks. Doing this takes it out of the worldwide scope and may be safely edited with out affecting different makes use of.

I wish to just like the reusable blocks characteristic in WordPress. I perceive the way it could possibly be one of many platform’s strongest instruments. Nevertheless, its implementation has but to stay as much as the potential it confirmed 4 years in the past when beneath growth in Gutenberg.

If we might repair the accidental-editing subject and the longstanding drawback with wide alignments not working (I couldn’t write this submit with out at the least noting that ticket), it might begin down the trail of turning into the characteristic it was at all times meant to be.

Leave a Reply

Your email address will not be published. Required fields are marked *