WordPress 6.0 Field Guide


Update on 5 May 2022: Updates to the @wordpress/create-block templating system and Block Locking Settings in WordPress 6.0 dev notesdev note Each important change in WordPress Core is documented in a developers note, (usually called dev note). Good dev notes generally include a description of the change, the decision that led to this change, and a description of how developers are supposed to work with that change. Dev notes are published on Make/Core blog during the beta phase of WordPress release cycle. Publishing dev notes is particularly important when plugin/theme authors and WordPress developers need to be aware of those changes.In general, all dev notes are compiled into a Field Guide at the beginning of the release candidate phase. were added to the BlockBlock Block is the abstract term used to describe units of markup that, composed together, form the content or layout of a webpage using the WordPress editor. The idea combines concepts of what in the past may have achieved with shortcodes, custom HTML, and embed discovery into a single consistent API and user experience. Editor section.


With the Release Candidaterelease candidate One of the final stages in the version release cycle, this version signals the potential to be a final release to the public. Also see alpha (beta). 1 officially shipped, itโ€™s time to explore the next major releasemajor release A release, identified by the first two numbers (3.6), which is the focus of a full release cycle and feature development. WordPress uses decimaling count for major release versions, so 2.8, 2.9, 3.0, and 3.1 are sequential and comparable in scope., WordPress 6.0. This release introduces Style variations, the Block Locking UIUI User interface, various writing improvements, more design tools, new hooksHooks In WordPress theme and development, hooks are functions that can be applied to an action or a Filter in WordPress. Actions are functions performed when a certain event occurs in WordPress. Filters allow you to modify certain functions. Arguments used to hook both filters and actions look the same., updated external libraries, and more! At a high level, there areย 97 enhancements and feature requests,ย 131 bug fixes and 13 Gutenberg bug fixes,ย 23 other blessed tasks, which brings us toย 251 Trac tickets in total.

The new performance team has been working hard to improve various parts of WordPress. A lot of queries have been optimized and some removed, cache improved, multiple translations of the same strings removed, just to mention a few.

Letโ€™s take a deeper look at what to expect in 6.0.

Note: some of the changes will require pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-partyPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party and theme authors to adapt or change their code. Please, read these Dev notesdev notedev note Each important change in WordPress Core is documented in a developers note, (usually called dev note). Good dev notes generally include a description of the change, the decision that led to this change, and a description of how developers are supposed to work with that change. Dev notes are published on Make/Core blog during the beta phase of WordPress release cycle. Publishing dev notes is particularly important when plugin/theme authors and WordPress developers need to be aware of those changes.In general, all dev notes are compiled into a Field Guide at the beginning of the release candidate phase. Each important change in WordPress CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. is documented in a developers note, (usually called dev note). Good dev notes generally include a description of the change, the decision that led to this change, and a description of how developers are supposed to work with that change. Dev notes are published on Make/Core blogblog (versus network, site) during the betaBeta A pre-release of software that is given out to a large group of users to trial under real conditions. Beta versions have gone through alpha testing in-house and are generally fairly close in look, feel and function to the final product; however, design changes often occur as part of the process. phase of WordPress release cycle. Publishing dev notes is particularly important when plugin/theme authors and WordPress developers need to be aware of those changes.In general, all dev notes are compiled into a Field GuideField guide The field guide is a type of blogpost published on Make/Core during the release candidate phase of the WordPress release cycle. The field guide generally lists all the dev notes published during the beta cycle. This guide is linked in the about page of the corresponding version of WordPress, in the release post and in the HelpHub version page. at the beginning of the release candidate phase. carefully to make sure your code is ready for WordPress 6.0 on May 24, 2022.

AccessibilityAccessibility Accessibility (commonly shortened to a11y) refers to the design of products, devices, services, or environments for people with disabilities. The concept of accessible design ensures both โ€œdirect accessโ€ (i.e. unassisted) and โ€œindirect accessโ€ meaning compatibility with a personโ€™s assistive technology (for example, computer screen readers). (https://en.wikipedia.org/wiki/Accessibility)

Along with performance, lots of work has focused on improving accessibility in various parts of the WordPress software.

Block Editor

The Block Editor updates bring new functionality, fixes, and more:

  • The ability to bundle multiple Style variations for block themes.
  • The option to create page content patterns that users can choose from to create their pages.
  • New ancestor property in block.jsonJSON JSON, or JavaScript Object Notation, is a minimal, readable format for structuring data. It is used primarily to transmit data between a server and web application, as an alternative to XML. letting one restrict where users can place their blocks.
  • A new block locking UI with a lock attribute for every block.
  • Registration of blocks from within themes.
  • Improved support for preserving unrecognized content in the editor.
  • More robust block theme export feature in the Site Editor.
  • Block markup updates for image, quote, list, and group blocks.
  • New set of Post Comments blocks, No Results block, and more.
  • & more!

Of note, if you currently have the GutenbergGutenberg The Gutenberg project is the new Editor Interface for WordPress. The editor improves the process and experience of creating new content, making writing rich content much simpler. It uses โ€˜blocksโ€™ to add richness rather than shortcodes, custom HTML etc. https://wordpress.org/gutenberg/ plugin active on your website and are upgrading to WordPress 6.0, please make sure Gutenberg is updated to its latest version. This helps ensure the best experience possible.

Letโ€™s dig in.

Bootstrap/Load

Amongst other performance improvements, in this release youโ€™ll be able to skip not needed queries with do_parse_request filterFilter Filters are one of the two types of Hooks https://codex.wordpress.org/Plugin_API/Hooks. They provide a way for functions to modify data of other functions. They are the counterpart to Actions. Unlike Actions, filters are meant to work in an isolated manner, and should never have side effects such as affecting global variables and output..

Cache APIAPI An API or Application Programming Interface is a software intermediary that allows programs to interact with each other and share data in limited, clearly defined ways.

In WordPress 6.0 wp_cache_*_multiple API becomes a full CRUDCRUD Create, read, update and delete, the four basic functions of storing data. (More on Wikipedia.). Also, option to flush the runtime cache without flushing the entire persistent cache is being enabled.

Media

Media has new filters and a few UI additions:

  • Enable edits to custom image sizes. Adds a filterย edit_custom_thumbnail_sizesย to allow users to enable editing individual custom image sizes. (#28277)
  • ย Add a โ€œCopy URLURL A specific web address of a website or web page on the Internet, such as a websiteโ€™s URL www.wordpress.org to clipboardโ€ function to the list table view. (#54426)

Weโ€™ll find performance improvements in Media component as well.

Posts, Post types/Taxonomies

WordPress 6.0 introduces more dynamic hooks for custom post types and taxonomies.

TaxonomyTaxonomy A taxonomy is a way to group things together. In WordPress, some common taxonomies are category, link, tag, or post format. https://codex.wordpress.org/Taxonomies#Default_Taxonomies.

Taxonomies received a lot of performance improvements, from term query caching and adding limits to taxonomy queries, through navigation menuNavigation Menu A theme feature introduced with Version 3.0. WordPress includes an easy to use mechanism for giving various control options to get users to click from one place to another on a site. items to changing term_exists to use get_terms().

Themes

This new release offers a streamlined way for theme authors to work with patterns, support for multiple theme.json files AKA style variations, better export themes with Site Editor, and a few more goodies.

Allow block themes to be activated withoutย index.php

This change removes the requirement for block themes to have an unusedย index.phpย template just for activation, as they use aย templates/index.htmlย file instead. (#54272)

Correct the logic for displaying aย _doing_it_wrong()ย notice forย add_theme_support( โ€˜html5โ€™ )

  • Callingย add_theme_support( 'html5' )ย without passing an array of supported types should throw aย _doing_it_wrong()ย notice: โ€œYou need to pass an array of typesโ€.
  • If the second parameter is not specified, it should fall back to an array ofย comment-list,ย comment-form, andย search-formย for backward compatibility.
  • If the second parameter is not an array, the function should returnย false.

For more info see #51657.

Users

With 6.0 WordPress installs with more than 10,000 users, so called โ€œlarge sitesโ€, will receive performance improvements for querying and counting users.

Other Developer Updates

WordPress 6.0 also brings:

  • Option for plugin authors to edit plugin description on theย Plugins > Add Newย and/orย Networknetwork (versus site, blog)ย Adminadmin (and super admin)ย > Plugins > Add Newย screens.
  • Ability to filter whole notification email in retrieve_password.
  • Possibility to remove site icons in multisitemultisite Used to describe a WordPress installation with a network of multiple blogs, grouped by sites. This installation type has shared users tables, and creates separate database tables for each blog (wp_posts becomes wp_0_posts). See also network, blog, site networks.

But Wait, There is More!

More thanย 131ย bugs,ย 97ย enhancements and feature requests, andย 23ย blessed tasks have beenย marked as fixed in WordPress 6.0.

Here are a few that havenโ€™t been highlighted:

  • Administration: Add aย media_date_column_timeย filter to the media list table date column. Similar to the existingย post_date_column_timeย filter in the posts list table, this change adds a new hook to filter the โ€œDateโ€ column output in the media list view. (#42942)
  • Build: Update webpack to v5.x. This aligns closer with how the Gutenberg plugin handles WordPress packages. Enable ReactReact React is a JavaScript library that makes it easy to reason about, construct, and maintain stateless and stateful user interfaces. https://reactjs.org/. Fast Refresh support to WordPress core for block development withย @wordpress/scripts. Bringย caniuse-liteย to the latest version which ensures that build tools target the most recent version of browsers supported by WordPress. (#51750, see #55505)
  • Build/Test Tools:
    • A .git-blame-ignore-revs file has been added to the repository with a curated list of โ€œpinking shearโ€ commits (ones only applying stylistic changes), making the blame feature on GitHubGitHub GitHub is a website that offers online implementation of git repositories that can easily be shared, copied and modified by other developers. Public repositories are free to host, private repositories require a paid subscription. GitHub introduced the concept of the โ€˜pull requestโ€™ where code changes done in branches by contributors can be reviewed and discussed before being merged be the repository owner. https://github.com/ much more usefulย (#55422)
    • Webpack and all related build processes/scripts have been updated to version 5ย (#51750).
    • The npm install command has been fixed for contributors using an Apple M series silicone by updating the grunt-contrib-qunit dev dependencyย (#52690).
  • Bundled Theme: If youโ€™ve been having problems with order of elements in comment form in Twenty Nineteen theme, thereโ€™s a good news for you in #46600. Itโ€™s fixed!
  • Canonical: Function redirect_guess_404_permalink() includes all public statuses, rather than just publish, in 404 redirects in its search. (#47911)
  • Comments:ย Speeding up Dashboard and Comment moderation SQL load โ€“ (#19901)
  • Emoji: Update the Twemoji to version 14.0.2. This version introduces support for the latest Emoji added in Emoji 14. (#55395)
  • External Libraries:
    • Update Jcrop to version 0.9.15. For a full list of changes, seeย https://github.com/tapmodo/Jcrop/compare/v0.9.12โ€ฆv0.9.15. (#54035)
    • Update jQuery Color to 2.2.0. Removes bundled version (still existed within core), in favor of expanding the Grunt build steps to include the package from NPM instead. (#55016)
    • Update random_compat to version 2.0.21. The latest release includes improved compatibility with PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 7.4 or higher 8.1, as well as some bugbug A bug is an error or unexpected result. Performance improvements, code optimization, and are considered enhancements, not defects. After feature freeze, only bugs are dealt with, with regressions (adverse changes from the previous version) being the highest priority. fixes for Windows platforms. Release notes: https://github.com/paragonie/random_compat/releases/tag/v2.0.21 (#55181)
    • Upgrade PHPMailer to version 6.5.4. The latest release includes some minor PHP cross-version improvements and a safeguard against hosters disabling security functions. Note to hosting providers: donโ€™t disableย escapeshellarg()ย andย escapeshellcmd(); itโ€™s not safe! Release notes: https://github.com/PHPMailer/PHPMailer/releases/tag/v6.5.4 (#55187)
    • Upgrade PHPMailer to version 6.6.0. Release notes: https://github.com/PHPMailer/PHPMailer/releases/tag/v6.6.0 (#55277)
    • Update sodium_compat to v1.17.1. The latest version of sodium_compat includes further improvements for PHP 8.1 compatibility. (#55453)
    • Update backboneย fromย 1.4.0ย toย 1.4.1., underscoreย fromย 1.13.1ย toย 1.13.2, and clipboardย fromย 2.0.8ย toย 2.0.10. (#55547)
  • Formatting:
    • Add support for formatting sizes as PB, EB, ZB, and YB. (#40875)
    • KSES: Add support forย <ruby>ย and related elements. This is especially commonly used in Japanese content, but it can also been seen in content of other languages like Chinese. The set of elements to enable such functionality consists ofย <ruby>,ย <rt>, andย <rp>ย in theย HTML Standard, while some browsers (like Firefox) additionally supportย <rb>ย andย <rtc>ย for more advanced formatting. (#54698)
    • KSES: Allowย lang,ย xml:lang,ย dirย attributes globally. Globally permit theย lang,ย xml:lang, andย dirย attributes on all elements rather than a subset in accordance with the HTMLHTML HyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. specification. (#54699)
    • Function get_the_author_link() is going to be pluggable in WordPress 6.0. A new filter, get_the_author_link, is added for altering author link output. (#51859)
  • I18ni18n Internationalization, or the act of writing and preparing code to be fully translatable into other languages. Also see localization. Often written with a lowercase i so it is not confused with a lowercase L or the numeral 1. Often an acquired skill.:
    • List item separator should be a WP_Locale propertyย (#39733)
    • Allow languages path in register_block_typeย (#54797)
  • Media:
    • Removeย attachment_fields_to_saveย filter and deprecateย image_attachment_fields_to_save(). This filter prevented removing attachment titles. This changeset removes the filter and deprecates the related function since it is no longer used. (#39108)
    • Enable edits to custom image sizes. With a new filter edit_custom_thumbnail_sizes users will be able to apply media edits to individual custom image sizes. (#28277)
  • Network/Sites: Improve cache key generation in WP_Site_Queryย (#55462)
  • Plugins:
    • Introduce theย plugin_install_descriptionย filter. This allows for modification of the plugin card description on the Add Plugins screen. (#55480)
    • Convertย apply_filters()ย into a proper variadic function. (#53218)
  • Posts, Post Types: Pass theย $updateย parameter toย wp_insert_post_dataย andย wp_insert_attachment_dataย filters. This makes it easier to determine in a callback function whether this is an existing post being updated or not. (#46228)
  • Posts, Post Types; Taxonomy: Translate default labels once. Improve the translationtranslation The process (or result) of changing text, words, and display formatting to support another language. Also see localization, internationalization. of post type and taxonomy labels by caching the translations during runtime.ย (#26746)

Please, test your code. You can use theย Beta Tester pluginย on a test site to validate how your plugin or theme functions with WordPress 6.0 RC1.ย  Fixing issues that your code has with WordPress core helps you and millions of WordPress sites.

Props toย @desrosj, @imath, @spacedmonkey, @swissspidy,ย @annezazu, @webcommsat, @jeffpaul, @costdev, @bphย for contributing to this guide.

#6-0, #dev-notes-6-0, #field-guide