WordPress.org

WordPress Developer Blog

What’s new for developers? (August 2023)

WordPress 6.3 landed on August 8, 2023. If you’re like me, you’re like a kid in a toy shop, sprinting down the aisles and pulling out every new thing you can reach on the shelves.

Of course, the first thing you’ll want to do is check the WordPress 6.3 Field Guide for new features and changes. Then, test your themes and plugins against the new release. And, finally, find your favorite new shiny objects!

But a new WordPress release doesn’t mean the wheel stops spinning. WordPress 6.4 is already in alpha and will land in November 2023. If you’ve got something on your wishlist, you still have a few days to make it known on the Make Core blog.

This edition of the What’s new for developers? monthly roundup is a mixed bag of goodies. Some features have landed in the 6.3 release; some are still only in the Gutenberg plugin. 

To be fair, the plugin is already two versions ahead of what merged into 6.3. And when you’re testing changes, it’s always a good idea to run the latest version of everything.

Highlights

Phase 3 updates

Three recent posts on the Make Core blog expand on the Phase 3: Collaboration roadmap:

  • Block Library envisions a single system for everything a user needs: blocks, patterns, post types, media, and more—and organizes it all, for a fluid experience in the editor and, especially, outside of it.
  • Admin Design outlines several goals for a modern, flexible WordPress redesign that makes it a pleasure to build beautiful user experiences.
  • Real-time Collaboration: architecture expands the previous discussion on collaborative features (below) with a broad-strokes outline of how the architecture would work in the post and site editors.

These posts come on the heels of the original four, which came out earlier in the summer. If you missed those, be sure to give them a read:

  • Real-Time Collaboration covers plans for concurrent collaboration, shared edits, visibility of peers, and lifting current editing restrictions.
  • Workflows imagines seamless collaboration over the whole editorial process, from first draft through publication and beyond.
  • Revisions proposes a complete overhaul of the current system in favor of one that works with blocks and tracks changes on every data layer, from the server stack to the user’s latest edits.
  • Media Library aims to expand media management capabilities, unify the interfaces and improve overall media workflows.

Extendable media inserter

Gutenberg 16.2 introduced the registerInserterMediaCategory API for registering media inserter categories. That lets you add a new sub-tab under Media in the inserter, which you can use for lots of things: to add more media types, perhaps, or integrate with third-party services—I know you’ll think of more.

Check out the API’s documentation in the Block Editor Handbook for more details.

Vertical text orientation support

New for your themes: support vertical text orientation in theme.json. Just set  settings.typography.writingMode to true, and the Paragraph blocks in the UI will sprout a new Text Orientation design tool. You can set that to horizontal or vertical.

Want to make vertical orientation the default Paragraph block style? Set styles[core/paragraph].typography.writingMode to vertical-rl.

You probably won’t set the default for every Paragraph block very often. But the feature should make it easier to build patterns that mix in some vertical text for effect.

Plugins and tools

Loading assets and the post editor iframe

WordPress 6.3 now places the post editor content in an iframe—if all registered blocks are on API version 3. If your themes and plugins are using the recommended methods to load scripts and styles, you should be fine with this.

Of course there’s an exception (there always is, somehow …) and that’s if you are using the enqueue_block_editor_assets hook to enqueue a script/style that specifically targets the content canvas. You can find out what hooks and functions you need to use, and why, in the Dev Note and this ticket on GitHub.

Development mode conditional function renamed

The wp_in_development_mode() function, added during the WordPress 6.3 development cycle, has a new name: wp_is_development_mode() to make it consistent with similar functions. If you were testing this before the 6.3 release, make sure you update all the instances accordingly.

New ProgressBar component

In Gutenberg 16.4, a new ProgressBar component lets you show progress to a user in a variety of scenarios. Eventually, for instance, the bar will replace the Spinner component when the Site Editor is loading, but that implementation is still to come.

Component updates

Now the RangeControl component supports the large 40px number input size. That size shows up across multiple core instances.

You can also pass an id prop to the TextControl component. That’s a good way to reference it somewhere else with an aria-* attribute.

Stabilized APIs

Three experimental APIs were stabilized in Gutenberg 16.4. That means they should be safe from backward-compatibility issues when you use them in production:

  • defaultBlock
  • directInsert
  • getDirectInsertBlock

A minimal HTML Processor

As part of the ongoing work for a more complete HTML API, a minimal version of the HTML Processor landed in trunk. This feature is targeted for a WordPress 6.4 release, but there is some pushback in the ticket on whether it should be included at all.

The HTML Processor currently only supports a subset of all HTML elements. This will give contributors time to test, review, and garner feedback on the initial architecture.

Interactivity API updates and Create Block script support

Gutenberg 16.3 adds runtime support for the wp-style core directive. Plus, a new gutenberg_should_block_use_interactivity_api filter hook lets you disable Interactivity API support on a per-block basis.

Contributors also added a template for the @wordpress/create-block package to help you start experimenting with custom interactive blocks.

Rest API updates

The REST API has a new endpoint for global styles revisions, a feature that shipped with WordPress 6.3. Get to it with /wp/v2/global-styles/revisions.

The WP_REST_Templates_Controller has a new modified field for template and template part objects. The field returns the post modified datetime.

Themes

Fixed width for wide/full Image blocks

The <img> element nested inside the Image block now has a fixed width of 100% when it is set to wide or full-width alignment. Test this with your themes to make sure this change does not break your design.

Avatar border selector

The global styles selector for the Avatar block now targets the wrapper instead of the inner <img> element. That’s how borders get applied at the block level, but it is a potential breaking design change in some cases, depending on how you were styling the block.

Pattern updates

WordPress 6.3 has shipped an overhauled Site Editor navigation interface that mostly helps your users manage patterns and template parts. Still, you should see what the changes are and how they work, so you can answer support questions. And especially if you build themes from the Site Editor.

The biggest change: the Library nav item is now called Patterns. This panel houses synced patterns (formerly reusable blocks), unsynced patterns (can be registered by users, WordPress, themes, and plugins), and template parts (grouped by area).

Some related tickets worth checking out are:

Helper function for getting theme-supported patterns from the Pattern Directory

If you’ve been grabbing theme.json-defined patterns via the WP_Theme_Json_Resolver class methods, you will want to switch to the wp_get_theme_directory_pattern_slugs() function now that WordPress 6.3 is out. The class is private and marked for internal WordPress use only. By contrast, the helper function is there for you to use. It will make sure you don’t run into breaking changes in the future.

Better Query Title block support for author archives

The Query Title block has always shown a generic title in the Site Editor—but not anymore. Now, in Gutenberg 16.3, it will contextually show the archive type in the placeholder text. For example, it will output “Category: Name” for a generic category template but “Category: Recipes” for the category-recipes.html template.

Block library updates

Several blocks have newly updated design-tool and feature support:

Technically, captions are an element, not a block. Either way, now you can control their color and typography in the Styles interface.

Bug fixes

Several fixes have shipped with Gutenberg and WordPress that should make your life easier.

You can style nested elements for blocks in theme.json. You could before, but a bug kept the styles from being generated on the front end.

When you’re on the site’s home page, the Home link block shows the .current-menu-item class. That’s how the other links work.

New and improved logic for caching the results in wp_theme_has_theme_json() takes into account that a site can switch themes.

Events and resources

Developer Hours

July’s Developers Hours showed attendees how to style blocks with CSS custom properties and then give theme authors access to the results.

Learn WordPress 

Learn WordPress hosted a workshop in July on WP-CLI  for PHP developers. If you missed it, or you were there but would like to see it again, it’s on WordPress.tv.

Learn also two new developer-oriented tutorials:

Developer Blog

Several articles landed on the Developer Blog in the past month:

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

Categories: , ,

Leave a Reply

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