WordPress Release: 5.8.1

Tag Name: 5.8.1

Release Date: 9/9/2021

WordPress LogoWordPress

World's most popular open-source content management system powering over 40% of all websites. Offers extensive plugin ecosystem, themes, and robust community support for blogs, e-commerce, and corporate websites. Highly customizable and scalable platform suitable for beginners and advanced developers.

TL;DR

WordPress 5.8.1 is a maintenance release that addresses several critical bugs affecting child themes, block editor functionality, and media handling. It fixes issues with bundled themes (Twenty Ten, Twenty Eleven, and Twenty Twelve) that were causing fatal errors and missing images when using child themes. The update also resolves problems with the block editor, including missing border settings for button blocks and improved block attribute serialization. Additionally, it enhances media library functionality, fixes embed display in widgets, and corrects several JavaScript library version references.

Highlight of the Release

    • Fixed fatal errors and missing images in child themes of Twenty Ten, Twenty Eleven, and Twenty Twelve
    • Restored missing border radius settings on button blocks
    • Fixed menu location saving when creating new menus
    • Improved media library experience with better layout on narrow screens and increased items per page
    • Fixed embeds not displaying in the widgets block editor
    • Corrected block attribute serialization between PHP and JavaScript

Migration Guide

No migration steps are required for this maintenance release. WordPress 5.8.1 is a bug fix release that addresses issues in WordPress 5.8 and should be a seamless upgrade.

If you're using child themes based on Twenty Ten, Twenty Eleven, or Twenty Twelve, this update will fix the issues with block patterns and images that were occurring in WordPress 5.8.

For theme developers who were working around these issues with custom code, you may now be able to remove those workarounds as the core functionality has been fixed.

Upgrade Recommendations

This update is highly recommended for all WordPress 5.8 users, especially for:

  • Sites using child themes based on Twenty Ten, Twenty Eleven, or Twenty Twelve
  • Sites using the block editor for widgets
  • Sites with extensive media libraries
  • Sites using button blocks in content

WordPress 5.8.1 contains numerous bug fixes that improve stability, compatibility, and user experience. The update addresses several critical issues that could cause fatal errors or broken functionality in certain configurations.

As with any WordPress update, it's recommended to back up your site before upgrading, though this maintenance release should not introduce any breaking changes.

Bug Fixes

Theme Compatibility Fixes

  • Fixed fatal errors in Twenty Ten child themes by using get_template_directory() instead of get_stylesheet_directory() when loading block patterns
  • Fixed missing images in block patterns when using child themes of Twenty Ten, Twenty Eleven, or Twenty Twelve by using get_template_directory_uri() instead of get_stylesheet_directory_uri()
  • Version bumped bundled themes to avoid file not found and fatal errors:
    • Twenty Ten: Version 3.5
    • Twenty Eleven: Version 3.9
    • Twenty Twelve: Version 3.5

Block Editor Fixes

  • Restored missing border radius setting on button blocks
  • Fixed block attribute serialization in PHP to match JavaScript equivalent
  • Prevented block editor JavaScript from loading in other editors
  • Fixed duplicate "404" templates appearing in the template dropdown

Menu and Widget Fixes

  • Fixed menu location saving when creating a new menu
  • Hidden bulk-select option when adding a new menu or when no menus exist
  • Fixed Custom HTML and Media widgets to display the correct fields in Accessibility Mode
  • Prevented collapsing expanded panel/section/control when Esc is pressed in the widget block editor

Media Handling Improvements

  • Fixed wp_unique_filename() to properly check for name collisions with all alternate file names when images may be converted after uploading
  • Fixed "Filter Media" fields display when replacing an image from the media modal
  • Applied the wp_editor_set_quality filter when saving converted images
  • Fixed a "Division by zero" PHP warning in wp_ajax_query_attachments() when a plugin changes the posts_per_page value to zero

Installation and Upgrade Fixes

  • Avoided creating nonce during installation, preventing "Table wp_options doesn't exist" database errors
  • Added missing files from WordPress 5.8 to the $_old_files list for cleanup during upgrades

New Features

Improved Media Library Experience

  • Increased the number of media items displayed per page from 40 to 80, improving navigation for sites with large media libraries
  • Fixed layout issues in the media library modal on narrow screens that were preventing media icons from displaying properly

Enhanced Block Editor Support

  • Added the wp-embed-responsive class to the body when using the widgets block editor, enabling embeds (like YouTube videos) to display properly
  • Improved loading of registered styles for block variations, ensuring block styles added via register_block_style() are properly loaded

Security Updates

No specific security fixes were mentioned in the release notes for WordPress 5.8.1. This appears to be primarily a maintenance and bug fix release focused on resolving compatibility issues, UI problems, and improving functionality.

Performance Improvements

Media Library Performance

  • Increased the number of media items displayed per page from 40 to 80, reducing the need for pagination when browsing media libraries
  • Improved handling of image conversion and file naming, preventing unnecessary file operations

Block Editor Optimizations

  • Conditionally loaded registered styles for block variations, ensuring styles are only loaded when blocks are rendered
  • Fixed broken loop in WP_Theme_JSON_Resolver that was causing inefficient processing of translatable paths

Impact Summary

WordPress 5.8.1 is a significant maintenance release that resolves several critical issues affecting theme compatibility, block editor functionality, and media handling.

The most impactful fixes address fatal errors and missing images in child themes of bundled themes (Twenty Ten, Twenty Eleven, and Twenty Twelve), restore missing UI elements in the block editor (particularly the button block border settings), and improve media library usability.

For content creators, the fixes to the button block, media library layout, and embed display in the widgets block editor will improve the content creation experience. Site administrators will benefit from fixes to menu management and customizer functionality.

Theme developers will appreciate the corrections to path handling for block patterns and images, which resolve compatibility issues between parent and child themes. Developers will also benefit from improved consistency between PHP and JavaScript block attribute serialization.

Overall, this release enhances stability and usability across WordPress 5.8, addressing the most significant pain points reported by users since its initial release.

Statistics:

File Changed51
Line Additions2,120
Line Deletions1,438
Line Changes3,558
Total Commits49

User Affected:

  • Fixed fatal errors and missing images when using child themes of Twenty Ten, Twenty Eleven, and Twenty Twelve
  • Corrected path handling for loading block patterns and images from parent themes
  • Added "Template Editing" to the list of WordPress theme features

Contributors:

desrosjpeterwilsonccSergeyBiryukovazaozz