WordPress.org

WordPress Developer Blog

What’s new for developers? (June 2023)

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.

Highlights

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

Gutenberg 15.8 introduced an experimental Details block that outputs a <details> HTML element and its <summary> child. That block is now stable and expected to ship with WordPress 6.3.

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

The experimental flag was removed from the Command Center, and its API is now public. So you can start experimenting with custom commands.

What to name it? That is the question, both in this open request for feedback on the Make Core blog and another separate discussion.

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 <InnerBlocks> component.

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

A new 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

A new 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_posts() and get_pages() has been resolved. 

The 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.

New hooks

A couple of new hooks have come to WordPress trunk in the past month:

jQuery updates

Over the past month, the jQuery version bundled with core was bumped to 3.6.4 and later 3.7.0 to match the latest releases.

Themes

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

The 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.

A previous change introduced a regression that broke the logic with a border style automatically being applied when a width was set to it. A recent patch corrected this bug.

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:

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

Developer Hours

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:

Hallway Hangouts

Two Hallway Hangout sessions featured good discussion around theming:

Learn WordPress

A new developer-focused tutorial is up on Learn WordPress:

Developer Blog articles

Four new articles went live in the last 30 days:

Props to @bph for co-writing and wrangling these resources, @ndiego, @thatdevgirl, and @marybaum for feedback and review.

Categories: , ,

3 responses to “What’s new for developers? (June 2023)”

  1. GX Avatar
    GX

    Hi! I have been using WordPress for years as an administrator. With the new editor update, the ability for the administrator to assign an author directly from the interface where I edit the article has been removed! Now I have to necessarily go to the article list page and make the edit to change the author. I find this inconvenient and impractical because, as an administrator, I often edit articles by other authors. Can you restore this functionality in the Admin editor sidebar?

    1. Birgit Pauli-Haack Avatar

      Hmm. That sounds like a conflict with a 3rd party plugin. The Author box is in the Post Tab and the Author dropdown allows for the author to be changed. This question would be better asked in the Support Forums, or you can also file a bug report on Gutenberg GitHub. For both you would need to provide more detailed information, though.

      1. GX Avatar
        GX

        Hi Birgit, nice to e-meet you! Thank you for your kind reply. I will follow your suggestions and provide as much detail as possible. That’s right, I thought the disappearance of the Author Box in the dropdown menu was a voluntary change in the Admin editor. It disappeared after the recent update. I hope to resolve the bug. Thanks again 🙂

Leave a Reply

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