Gutenberg 16.4 has been released with a new auto-inserting blocks experimental feature. It allows developers to specify a location in which the block will be automatically inserted, such as before or after a template. The block can then be repositioned after insertion using the editor tools.
“This applies both to the frontend and to the Site Editor (via the REST API), allowing for further user customization,” Automattic-sponsored engineer Sarah Norris said in the 16.4 release post. She posted a video demonstrating how it works with an example “like” block:
Although the auto-inserting blocks is still behind the experimental flag, developers can try it by adding an __experimentalAutoInsert
field to the block.json file of a dynamic block. Example code is available in the release post.
“This feature aims to improve the extensibility of block themes through plugins and continues to be actively developed,” Norris said.
The GitHub ticket for auto-inserting blocks describes a common scenario from the days of classic themes where a plugin would use a filter to auto-append a login/logout link to a navigation menu. This is no longer possible with block themes, so contributors have devised auto-inserting blocks as a creative solution that retains ease of use offered by simply activating a plugin and preserves the ability of the user to modify the blocks once inserted.
Gutenberg 16.4 also introduces a new, horizontal ProgressBar
component that can be used throughout the interface. It may soon replace the Spinner
component that is currently used in the Site Editor loading experience. An indeterminate version (indicates that a process is occurring but with no specific progress measurement) and a determinant version (a progress bar that indicates the progress made, moving towards 100%) are included in this component.
The Command Palette, which landed in WordPress 6.3 earlier this week, is getting three new commands in this release:
- Show/hide block breadcrumbs
- Enable/disable pre-publish checklist
- Preview in a new tab
WordPress’ block library has expanded design control support for the following blocks:
- Footnotes: Add link, background, and text color support. (52897)
- Footnotes: Add typography, dimensions, and border block supports (53044)
- Preformatted: Add spacing support. (45196)
- Social Links: Add Threads Icon. (52685)
- Verse: Enable the line breaks. (52928)
Check out the 16.4 release post for more details on all the enhancements, bug fixes, and accessibility and performance improvements.