It’s hard to believe that another month has gone by since the last round of the What’s new for developers? series. Quite a bit has happened in the last few weeks.
WordPress turned 20 years old. People shared celebratory videos online. Others celebrated with friends and cake. WordPress birthdays are sort of a big deal around these parts. And, the 20th?…Well, that’s something extra special.
In other news, the WordPress 6.3 development cycle kept spinning along. There is a lot to cover, so let’s get to it.
When testing features mentioned in this post, be sure to use the latest version of WordPress trunk and at least Gutenberg 15.9.1.
Table of Contents
First steps toward synced patterns
As the old saying goes, “If I had a nickel for every time a developer asked for synced patterns…”
Synced patterns are a highly-requested feature that will let you create design-locked, updatable patterns. The idea is that the content of the pattern would be editable, but its design aspects would stay firmly within the theme’s control.
This feature isn’t quite a reality, but a recent pull request added an experimental
syncStatus attribute for patterns, and a second patch added a class name to the Pattern block wrapper. There are known issues in the linked ticket that contributors are working on.
This is a step—a leap, really—toward making synced/updatable patterns a tool in every WordPress developer’s toolbox.
Details block no longer experimental
But to get the block out of the experimental stage, contributors scaled back the original version of it. Originally, the Details block had two nested blocks—one for editing the summary and one for editing the content. The current version is one block.
The upside of the change: it simplifies the user experience. The downside is that there is no way you can customize the summary element with just the design tools. You must use custom CSS instead.
Interactivity API and Behaviors UI bundled
The Interactivity API, a standard approach to building interactive front-end features, is now bundled in the Gutenberg plugin. At the moment, it is experimental, but its inclusion will let contributors begin testing ideas and ironing out bugs in the API.
One of those ideas is a lightbox feature on the Image block, which uses a new Behaviors UI. Another is an experimental integration with the File block. You can test both and more: visit Gutenberg > Experiments in your WordPress admin and enable the Interactivity API and Behaviors UI setting.
A public API will probably not land in WordPress 6.3, but early testing and feedback could pave the way for it to ship with 6.4.
Plugins and tools
Public API for the Command Center
Prioritize inserter items
Container-type blocks can now prioritize which nested blocks appear at the top of the inserter. You can use this feature by passing an array of block or block variation names via the
inserterPriority parameter of the
Transforming block variations
Block variations now show up in the block switcher. That makes it easier for you to switch from one variation of a block to another.
New slot for the Template sidebar
PluginTemplateSettingsPanel slot lets you add custom controls to the Template sidebar in the editor. It’s part of Gutenberg 15.9, which also makes the Template Editor in the edit post screen and the Site Editor look and work alike.
Set the last change value for cache groups
wp_cache_set_last_changed() helper function lets you set the last changed value for cache groups. That function can be useful for invalidating the cache.
get_pages() now uses WP_Query internally
A 13-year-old ticket that sought consistency between
get_pages() has been resolved.
get_pages() function is now a wrapper for
WP_Query, but you should still be able to use its custom arguments like
child_of, which map internally to appropriate query arguments. To make sure that it is backward compatible, please help test it thoroughly.
A couple of new hooks have come to WordPress trunk in the past month:
pre_wp_setup_nav_menu_item: A filter for short-circuiting
get_pages_query_args: Filters query arguments passed to
Fluid typography leverages the theme-defined “wide” size
An enhancement to the fluid typography system now uses the
layout.wideSize defined in
theme.json to set the max viewport width. Essentially, this defines the point where fonts will stop growing larger. Before, it was set at
1600px, which is generally much wider than the wide size a theme will define.
Block library updates
Social Links now have color classes. That means they can correctly reflect changes in the Styles UI, particularly across style variations of a theme. The hex color codes are still there, mostly as a fallback for when users switch to themes that do not have the same color slugs.
A recent enhancement also added wide and full alignment support to the Code block.
Bug fixes and reversions
get_the_author() function now returns an empty string if it is called before the global
$authordata variable is set. Previously, it returned a
null value, which triggered a “null to non-nullable” deprecation notice in PHP 8.1.
Another regression in core caused styles registered for blocks to load after other styles. This change had to be reverted, because it broke the expected loading order that has been in place since WordPress 5.0.
Post Content block disallowed in the post editor
You can no longer insert the Post Content block into the content canvas of the post editor, even if it’s nested inside of a Query Loop. That does not affect registered block patterns—if they have Post Content within them, you can still insert the pattern itself. But it may change how you build some pages with custom queries going forward.
Noteworthy user-centric changes
These changes are worth keeping an eye on, because they are related to themes or front-end output. But they should not directly affect how you build themes:
- The Site Editor has a new Revisions UI.
- You can see theme previews for block themes.
- Language and text-direction options are now part of the RichText formatting tools.
- The Site Editor now waits to display until it has fully loaded. If you have an extension that fetches a lot of data, test against this change to see what it does to the user experience.
FSE Program summaries
The FSE Program’s 24th call for testing is open to volunteers. It runs through several features expected in WordPress 6.3, so it is a good chance to get familiar with and leave feedback on features from this development cycle.
The past month saw two summaries posted for previous rounds of the FSE Program:
Events and resources
WordPress Playground, an experimental in-browser WordPress that runs without a PHP server, is getting close to a more official release. In the past month, two separate Developer Hours sessions demoed the project, at times that worked in two different time zones. Watch them on WordPress.tv:
Two Hallway Hangout sessions featured good discussion around theming:
A new developer-focused tutorial is up on Learn WordPress:
Developer Blog articles
Four new articles went live in the last 30 days:
- useEntityRecords: an easier way to fetch WordPress data
- Curating the Editor experience with client-side filters
- Customizing core block style variations via theme.json
- Using block inspector sidebar groups