Gutenberg 16.4: Experimental Auto-Insert Blocks Introduced

Gutenberg 16.4 Introduces Auto-Inserting Blocks and More Enhancements

The latest release of Gutenberg, version 16.4, brings several exciting features and improvements to the WordPress block editor. One of the notable additions is the new auto-inserting blocks experimental feature. This feature allows developers to specify a location where a block will be automatically inserted, such as before or after a template. Users can then reposition the block using the editor tools.

According to Sarah Norris, an engineer sponsored by Automattic, this feature applies to both the frontend and the Site Editor via the REST API, providing further customization options for users. Norris demonstrated how the auto-inserting blocks work with an example “like” block in a video shared in the 16.4 release post.

Although the auto-inserting blocks feature is still behind the experimental flag, developers can try it out by adding an “__experimentalAutoInsert” field to the block.json file of a dynamic block. The release post provides example code for developers interested in exploring this feature.

Norris emphasized that this feature aims to improve the extensibility of block themes through plugins and is actively being developed. It addresses a common scenario from the days of classic themes where a plugin would auto-append a login/logout link to a navigation menu using a filter. With block themes, this functionality is no longer possible, so auto-inserting blocks offer a creative solution that retains ease of use while allowing users to modify the blocks once inserted.

In addition to auto-inserting blocks, Gutenberg 16.4 introduces a new horizontal ProgressBar component that can be used throughout the interface. This component may soon replace the Spinner component currently used in the Site Editor loading experience. It includes both an indeterminate version, indicating that a process is occurring without specific progress measurement, and a determinant version, which indicates progress moving towards 100%. Videos showcasing these progress bars are available in the release post.

The Command Palette, which was introduced in WordPress 6.3, receives three new commands in this release. Users can now show/hide block breadcrumbs, enable/disable the pre-publish checklist, and preview content in a new tab using these commands.

The block library in WordPress also receives design control support for several blocks. The Footnotes block now has link, background, and text color support, as well as typography, dimensions, and border block support. The Preformatted block gains spacing support, while the Social Links block adds the Threads Icon. Lastly, the Verse block enables line breaks for improved formatting.

For more details on all the enhancements, bug fixes, and accessibility and performance improvements in Gutenberg 16.4, refer to the official release post.

In conclusion, Gutenberg 16.4 brings exciting new features to the WordPress block editor, including the auto-inserting blocks experimental feature and a new ProgressBar component. These additions enhance the extensibility and customization options for block themes and improve the user experience. Developers can explore these features by trying out the provided code examples, while users can look forward to a more streamlined editing experience with added design control for various blocks.

Stay in Touch

spot_img

Related Articles