WordPress.org

WordPress Developer Blog

What’s new for developers? (December 2023)

Happy holidays, extenders! We’re closing in on a full year of these developer-focused monthly updates, and I am happy with the feedback we’ve received over the last 11 months (we launched the first edition of What’s new for developers? in February 2023).

In this final edition of this monthly roundup for 2023, well…it’s more of the same—news of experiments, enhancements, bug fixes, and other things you should know about as an extender building atop WordPress.

As an aside, take some time to relax this holiday season, perhaps even spending some time away from the keyboard. WordPress will still be here if you take a day or two with family or friends. 

For now, let’s jump into the latest updates one last time this year.

As usual, make sure that you’re testing any code changes listed below against WordPress trunk and the latest version of the Gutenberg plugin.

Highlights

Roadmap to 6.5 published

An early version of the roadmap to 6.5 is now available on the Make Core blog. It lists the projects that are slated for the next WordPress release in March 2024. The article describes in short the enhancements and new features planned and provides links to the tracking tickets, so you can follow along on the development process.

The Font Library is on top of the list, as are other design tools and features for the Site Editor like revisions enhancements, Navigation block for mobile, patterns, and more support for Classic themes. For plugin developers, the new Data Views and APIs for Interactivity, Custom Fields, and Block Binding might be of great interest. The article also mentions the work on a plugin and theme roll back after automatic updates, dependency management, PHP compatibility, and overall performance improvements.

Plugin Directory Live preview available for opt-in

After an unsuccessful launch of plugin previews in September, contributors took feedback from the plugin development community and have relaunched the feature, albeit in a limited testing state.

If you have a plugin in the directory, you can now begin testing the live preview system. There is a two-stage opt-in process. The first step was meant to let you test the preview privately before enabling it for the public in the second step.

This week, the feature was taken live. Should a plugin developer opt-in into the new feature, users can preview a plugin’s functionality via WordPress playground instance.

Block gap support for the Quote block

Gutenberg 17.1 added support for blockGap to the Quote block. This lets you control the spacing between nested elements and blocks.

This was labeled as an enhancement in the ticket, but it was more of a bug for anyone building themes. Previously, you had to fix the spacing for Quote blocks with custom CSS so that it matched your overall spacing scheme. Be sure to remove any CSS you’ve added to test this change.

Block-focused Theme Handbook chapters

Over the last couple of months, several new chapters have been added to the WordPress Theme Handbook, each with a focus on modern block theming:

These new chapters are a part of a larger project to overhaul the Theme Handbook. The project still needs more contributors, and you can get involved by picking up a topic from the GitHub tracking ticket.

Plugins and tools

Updates to Data Views experiment

While it is not currently something that needs your full attention, you should keep an eye on the admin data views experiment. To test the latest changes, you must enable the New admin views option via the Gutenberg > Experiments admin screen.

Contributors have submitted dozens of changes over the past month, bringing the feature one step closer to a reality for all WordPress users. To keep updated with each change, follow the Data Views tickets on GitHub. Development is currently moving too fast to cover them all in this post.

Tabs component updates

The new Tabs component, which replaced the previous TabsPanel in Gutenberg 16.9, has received a couple of updates since its introduction:

Interactivity API updates

Gutenberg 17.2 incorporates a new store() API for the Interactivity API and it will now be served as a native module. If you have a previous implementation with the Interactivity API, you should check out the updated docs and migration guide to learn more.

New selectors to fetch entity revisions

Gutenberg 17.2 introduced the following two new functions to the Core Data API for fetching post revisions of post types that support revisions:

HTML API adds support for container elements

The HTML API has been updated to add support for container elements, such as article, blockquote, details, summary, and more. This enhancement to the HTML Processor will be available in WordPress 6.5.

Standardized default submit_button() values

As part of the ongoing effort to standardize functions across the WordPress codebase, the default values for the parameters of the submit_button() function have been changed from null to an empty string to match the parameters of  get_submit_button() which is wrapped by submit_button().

Serialized template content exposed to filters in Block Hooks API

Introduced in WordPress 6.4, the Block Hooks API exposes a filter (hooked_block_types) that allows you to automatically insert blocks relative to instances of other block types. The filter includes a $context argument, among others.

If the filter was called on a block that’s part of a template or template part, $context is set to the corresponding WP_Block_Template object. Previously,  this object’s $context was not exposed to the filter. This issue was patched in WordPress 6.4.2. 

External library updates

PHPMailer and getID3 have been updated to their latest versions (6.9.1 and 1.9.23 respectively) to provide better support for newer versions of PHP and to take advantage of the various bug fixes and new features they provide. 

Additionally, some internal Javascript has been created to remove the dependency on the downloadjs package when exporting and downloading theme files.

Updates to the experimental DropdownMenu V2 component

There have been a number of tweaks to the new version of the DropdownMenu component, including adding support for rendering in the legacy popover slot. Keep in mind that this component is still marked as experimental and may change in the future.

Raising the minimum version of MySQL

In WordPress 6.5, the minimum required version of MySQL will be raised from 5.0 to 5.5.5. (as of 57173). Using 5.5.5 also ensures two things:

  • The presence of utf8mb4 support (added in MySQL 5.5.3)
  • InnoDB is the default storage engine instead of MyISAM (added in 5.5.5).

Themes

Disallow custom content size controls

Gutenberg 17.2 introduced a new theme.json layout setting for disabling custom content and wide sizes in the UI. This will give you more control over what your users or clients can do with design tools. The new layout.allowCustomContentAndWideSize setting can set globally or at the block level:

{
	"$schema": "https://schemas.wp.org/trunk/theme.json",
	"version": 2,
	"settings": {
		"layout": {
			"allowCustomContentAndWideSize": false
		}
	}
}

Directory patterns shown in Patterns library

You can define patterns in theme.json via the patterns property, which are then shown in the inserter for users. In Gutenberg 17.1, these same patterns will appear in the Patterns library in the Site Editor.

Singular Query Loop handling in WordPress 6.4

WordPress 6.4 changed the way the Query Loop works for single posts, pages, and other custom post types, at least when you’re running a block theme. Because block themes do not add the loop themselves, WordPress will automatically handle the loop under the hood.

Layout classes added to legacy Group inner container

When a classic theme enables support for appearance-tools but does not have a theme.json file, an inner container is added to Group blocks. In Gutenberg 17.2, this inner container will now have layout classes applied to it.

Aside from a few special cases, most blocks can be renamed in the UI or via block markup. Gutenberg 17.2 adds the Nav Link block to the list of those that cannot be renamed.

Image blocks nested inside of Gallery blocks now have transparently styled scrollbars. This addresses a longstanding design issue with long captions that didn’t fit well into the small space allotted to them. 

This change adds new CSS with high specificity, targeting .wp-block-gallery.has-nested-images figure.wp-block-image figcaption. If you’ve added custom scrollbar handling in your themes, be sure to test that this new code does not break your custom styles.

HTML rendered in post titles

WordPress has long supported HTML in post titles, but the block editor has not rendered that HTML visually. This meant there was no way for you to perceive such markup. An update in Gutenberg 17.2 allows you to visualize the markup in Visual Mode and see the raw markup in Code Mode.

This update does not let you edit the post title’s HTML in Visual Mode, but there is a followup ticket requesting a Rich Text toolbar to edit the markup.

Notable bug fixes

Events and resources

Learn WP

Three new tutorials landed over the past month:

Developer Hours and Hallway Hangouts

There were two Developer Hours and Hallway Hangouts sessions in November:

Developer Blog

Four new posts were published on the Developer Blog in the past month:

Props to @bph, @juanmaguitar, @welcher, and @ndiego for co-writing this month’s post. WordPress notebook photo by @wpfanyi.

Categories: , ,

Leave a Reply

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