Gutenberg and Wunderbar

WordPress overhauled its core page editing system when Version 5 was released, and the result – Gutenberg – has dramatically changed page editing.

At  Gutenberg's introduction, a variety of Block Editing options were trying to improve upon WordPress' classic but simple HTML editor. They almost always worked by embedding all sorts of shortcodes into the content. That makes them generally incompatible with the Wunderbar, which is designed to create and work with pure, properly-formed HTML.

Instead of shortcodes, Gutenberg works its block-editing magic by surrounding HTML content with HTML comments containing embedded metadata. Wunderbar is compatible with Gutenberg because it also works with plain HTML, and leaves all comments that find alone.

That's not to say that as the Gutenberg ecosystem matures, and new and more complex gutenberg blocks are developed, that some Gutenberg pages may not hold up if you also try to use the Wunderbar to edit them.

But for classic content – text, images, tables, lists and the like – the Wunderbar is still ideally suited.

In some situations it may be useful to reverse roles with Gutenberg and the Wunderbar.

Rather than allowing the Wunderbar to edit Gutenberg content, you use Gutenberg to define a Wunderbar-editable block. The Wunderbar includes a Gutenberg block that can be inserted into content. If you choose this approach, you would want to make the REST of the page UNEDITABLE – otherwise matters get confusing. the easiest way to do this is to uncheck the “Edit Content” option in the Wunderbar admin. Doing that, post content will not be editable via Wunderbar UNLESS you include a Wunderbar block from the back end.

This opens up interesting possibilities for allowing clients to selectively edit portions of specific pages while keeping the rest of the site contents protected.

Wunderbar blocks include four customization options, the same as the Wunderbar shortcodes. The first will change the default name of the block, which usually matches that of its parent page. You have the option to to change the default “placeholder” text that displays if no block content is present. You can also enter the name of a user who is allowed to edit the content, or a particular role which is allowed to edit the content from the front end of the site.

The Wunderbar's Gutenberg blocks use the same technique as its [put_content_here] shortcodes – the content is stored in a custom post type called “wunderbar.”

Additional third party plugins may be helpful. By adding the free “Custom Post Type UI” plugin and telling it about the “wunderbar” post type, you can add back-editing editing of all the wunderbar shortcodes or Gutenberg blocks. There are also many WordPress plugins such as “PublishPress Capabilities” that can create and manage user roles, so you can prevent users from accessing content EXCEPT those Wunderbar blocks or shortcodes which you've assigned them to.

Leave a Reply

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