What’s new for developers? (September 2023)


We’re now well into the WordPress 6.4 development cycle. With Beta 1 just a few weeks away on September 26, 2023, the pace of collaborating on new features, bug fixes, and other changes is picking up.

WordPress 6.4 is planned for release on November 7, 2023 and is being led by an underrepresented gender release squad. Check out the Roadmap to 6.4 to get all the details.

WordPress 6.3.1 was released on August 29, 2023. It was a maintenance release that fixed several bugs. If you haven’t updated yet, now’s the time to do it!

Lots of changes have landed in WordPress trunk and the Gutenberg plugin over the last month. Before trying any of the new features or changes below, make sure you’re running the latest version of each to avoid errors.

Highlights

Block hooks (auto-inserted blocks)

Comment Template block sidebar inspector controls. It has a "Plugins" section with a "WP Like Button" toggle.

In version 16.4, the Gutenberg plugin added an experimental API for plugins to automatically insert blocks. This feature is now starting to take shape and is getting some UI love. Its inclusion in core is planned for WordPress 6.4, but it needs your help with testing and feedback.

Gutenberg 16.6 added a new post settings panel (currently labeled Plugins) to let users toggle the insertion on or off. Building off this UI update, another pull request added the block icons next to the toggles.

This feature was originally known as “auto-inserted blocks” but was renamed after some discussion.

Block design tool and support updates

WordPress post editor with demo text and a section with Footnotes.

Contributors continue to expand design tool support for existing blocks in the block library. The latest blocks and their supported options are:

A few blocks have also gained some noteworthy settings:

Standardized admin notices

WordPress Dashboard screen with an admin notice at the top of the screen.

WordPress trunk added a dedicated function for adding admin notices: wp_admin_notice(). 🥳

The function standardizes how themes and plugins register custom admin notices. It supports all the usual types of notices: error, success, warning, and info. It also handles outputting the dismissible “x” button, but you still have to roll your own functionality for persistently storing whether a user dismissed the notice.

Plugins and tools

Node.js and npm minimum version requirements

Both WordPress and Gutenberg now require Node.js 16.x and npm 8.x to contribute. This doesn’t necessarily affect your custom plugins since it’s specifically for the core codebase, it is generally good practice to stay on track with what the core project uses. Find out more about this change on the Make Core blog.

Command Palette API updates

The Command Palette API launched with WordPress 6.3, and contributors are already adding some nice touches to the interface, such as improved rendering on smaller viewports. But for extenders, you can now register custom commands without icons

New public APIs

The useBlockEditingMode() hook is now public, which means you can begin using it in your custom blocks. This change also makes the getBlockEditingMode selector along with the setBlockEditingMode and unsetBlockEditingMode actions public.

The HTML API adds <button> support

Last month, a minimal HTML Processor landed in WordPress trunk as part of a larger effort to create a full HTML API. It supported a subset of HTML elements. The latest work on this project adds support for the <button> element.

Better performance for block_has_support() and string-based feature check

The block_has_support() function now lets you use a string for its $feature parameter. Previously, only an array was allowed, but since most checks are for a single feature, it makes sense to allow for strings too. Plus, there is a minor performance boost when using a string check.

Modernized wp-embed script update

The wp-embed script has now dropped obsolete browser support, particularly for IE10/11. Neither of these are officially supported in WordPress anymore, so this should have no impact. The changeset included a few other updates to modernize the wp-embed script code that are worth checking out in the rare case that you have a custom script that extends it.

Improvements for third-party editors

If you are building a custom block editor, a few changes just landed in the Gutenberg plugin that should make development a little easier:

Interactivity API updates

In August, there was an official status update on the Interactivity API. The post outlines the current state of the API, the roadmap, learning resources, and more. Its inclusion within core WordPress will likely be version 6.5 or later, depending on how work progresses.

In the meantime, several updates landed in the Gutenberg plugin and are available for you to test:

New Options API functions for improved performance

Functions for priming options and setting autoload values were added to WordPress trunk:

  • prime_options() loads multiple specific options with a single database request if they have not already been loaded and cached.
  • prime_options_by_group() is a wrapper to prime all options of a specific option group.
  • wp_set_option_autoload() sets the autoload value for a single option.
  • wp_set_options_autoload() sets multiple options to the same autoload value.

Available post mime types hook

A new get_available_post_mime_types hook was added to WordPress trunk. Its primary goal is to let developers filter it to improve performance, especially on sites with many posts. Any filters you add could skip the database query altogether or cache the results. 

Note that this function could be renamed to pre_get_available_post_mime_types before the WordPress 6.4 release. Check out the Trac ticket to follow the discussion.

WordPressCS 3.0.0 released

Version 3.0.0 of the WordPress Coding Standards package was released, which should be a more accurate, performant, and stable tool. The package now requires that you install it with Composer, so you may need to update your workflow if you were not using Composer before.

Themes

Configure min and max viewport widths for fluid typography

You can now configure the minimum and maximum viewport widths for the theme.json fluid typography feature. The two new properties act as boundaries for fluid font sizes. Any viewport size between the min and max is fluid, but outside of the boundaries, font sizes are static.

Layout UI control in theme.json

You can now configure whether the Layout controls appear in the editor. When you set the settings.layout.allowEditing property to false in theme.json, it disables the controls for all blocks. But you can also configure this setting for individual blocks.

Main query triggered for block theme single templates

Because most block themes do not use the Query or Post Template blocks, they never trigger the main query. This has had a ripple effect throughout the ecosystem where plugins and core WordPress expect the post query to run.

A recent update in WordPress trunk ensures that the main query loop runs for singular content in block themes. You should test this with your block themes and plugins that rely on the main query to see if it corrects any known issues or creates any new ones.

Theme stylesheet value added as template part attribute

Gutenberg now automatically injects the theme attribute when rendering a template part in the editor or on the front end. This is to fix an issue where template parts are not correctly rendered when referenced from a pattern.

New functions for getting templates and parts

Two new functions were added to WordPress trunk for accessing theme.json data related to templates and parts:

Experimental: client-side Query Loop pagination

The Query Loop block now supports native client-side pagination thanks to continued experimentation with the Interactivity API in Gutenberg. This is an early solution and likely to change, but you can begin testing it now.

The setting to enable this feature is located under User Experience > Enhanced pagination in the Query Loop block’s inspector controls.

Image block updates

The Image block has received several updates in the last couple of Gutenberg releases. Most of them are user-facing changes that address issues with how aspect ratios work. Two of these changes could impact how you build templates or patterns.

When an Image block is wide or full width (i.e., not resizable), the dimensions controls now disappear. Alongside this change, the selected aspect ratio for the block is cleared.

Bug fixes…lots of ‘em

Having trouble getting fluid typography to work in WordPress 6.3.0 or 6.3.1? This is a known issue when using a fluid or variable size for wide layouts, and a fix is already lined up for 6.3.2. If you cannot wait until then, you can set a static value for settings.layout.wideSize in theme.json as a temporary fix.

Contributors have addressed several theming-related issues in the past month:

Post prefix removed from blocks

The “Post” prefix was removed from several block titles. This is primarily a user-facing change to clean up the UI, but it may take some adjustment when searching for blocks in the inserter. The updated blocks are:

  • Author
  • Author Biography
  • Author Name
  • Comment
  • Comments Count
  • Comments Form
  • Comments Link
  • Content
  • Date
  • Featured Image

Events and resources

Learn WordPress

Two new developer tutorials landed on Learn WordPress in the last month:

Developer Hours

The latest Developer Hours session introduced the HTML API. The first part of that API, the Tag Processor shipped with WordPress 6.3, but contributors are still fleshing it out to make it a more robust set of tools for plugin and theme development.

Hallway Hangouts

There was a single Hallway Hangout in August that covered how to extend blocks within themes. The session was a followup to the three-part Beyond Block Styles series published on the Developer Blog.

Developer Blog

Four new posts were published here on the Developer Blog over the past few weeks:

Props to @bph for co-writing and wrangling these resources and @webcommsat and @juanmaguitar for feedback and review.

Tags:

5 responses to “What’s new for developers? (September 2023)”

  1. jrf Avatar
    jrf

    I’m kind of missing a mention of the release of the 3.0.0 version of the WordPress Coding Standards in this post…. bit of a glaring oversight….

    https://make.wordpress.org/core/2023/08/21/wordpresscs-3-0-0-is-now-available/

    1. Justin Tadlock Avatar

      Cool. I updated the post with the additional info.

      You can also share things you’d like to see included in these posts via the Monthly Roundup tickets on GitHub. It’s a community-driven project that anyone can contribute to.

  2. ProxxiM Avatar

    I like the addition of the Lightbox feature for images! I hope there will be an easier way to enable it for galleries as well, currently the user needs to manually enable it for every single image in the gallery. That’s probably not the desired workflow.

Leave a Reply

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