WordPress 5.7 — What you need to know
A lot of information aimed at developers was shared this week about the upcoming release of WordPress 5.7, which is scheduled to be released on March 9, 2021. 📅
The most important document to review is the WordPress 5.7 field guide. If you’ve been testing the betas, you’ll want to bookmark it. 🔖
I’m going to single out a few details here, but all items are mentioned or linked to in the field guide, and there’s more you may want to look at there. 📖
The 5.7 release currently holds 66 enhancements and feature requests plus 127 bug fixes.🐛
There is also the ongoing cleanup following the update to jQuery 3.5.1. As Andrew Ozz noted in 2020, “this has been a long time coming” — five years to be exact. We’re nearing the third and final step of eventually removing jQuery Migrate altogether.
Many of us are looking forward to the improved HTTPS detection and migration enhancements that simplify the migration of a site from HTTP to HTTPS. If the current hosting environment supports HTTPS, a button will appear “in the HTTPS status section in Site Health, which switches the site from HTTP to HTTPS with a single click.” Hosts will be able “to supply a custom URL with instructions or for a one-click update” in the Site Health section. 🧑⚕️
To achieve these enhancements for the end-user, “WordPress 5.7 introduces a new wp_replace_insecure_home_url()
function that’s hooked into “various pieces of content” to replace non-HTTPS URLs “on the fly.” wp_replace_insecure_home_url()
relies on another new function, wp_should_replace_insecure_home_url()
, which “determines whether the URL replacement logic needs to run or not.” The conditions for the automatic content rewrites to kick in are as follows:
• The site has to be using HTTPS, via
wp_is_using_https()
.• A new internal flag option called
https_migration_required
has to be enabled. The option is automatically enabled when the “Site Address” and “WordPress Address” are switched to their HTTPS counterpart on a site with existing content. (In other words, afresh_site
that is immediately switched to HTTPS does not trigger the content rewrites logic.)• The “Site Address” and “WordPress Address” have to be using the same domain.
With the 5.7 release, we will see the beginnings of a larger project: cleaning up the WordPress admin CSS. A new streamlined color palette slims down to seven core colors and a range of 56 shades that meet the WCAG 2.0 AA recommended contrast ratio against white or black.
There are several REST API changes too, along with new i18n filters and createI18n()
changes.
5.7 introduces a new feature that allows website administrators to manually send a reset password link to existing users.
👨💻 Some miscellaneous developer-focused changes include:
- A new filter to allow the
wp_mail() function
to be short-circuited without having to define a custom version of the entire function. - Better error handling in the Cron API.
- Two new functions have been introduced to determine whether a post status or post should be viewable more easily.
- The
update_post_term_count_statuses
filter can be used to adjust the list of post statuses used when counting posts for a term.
WordPress 5.7 is also ready to be translated.