Miscellaneous developer changes in WordPress 6.5


Table of contents


Administration

A new_admin_email_subject hook is introduced, which filters the subject line of the email sent when a change of site adminadmin (and super admin) email address is initiated. (59250)

The default cursor style has been adopted for labels when its associated form controls are disabled, which improves 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). (59733)

Bootstrap/Load

Two new functions have been introduced to check whether WordPress is serving a REST APIREST API The REST API is an acronym for the RESTful Application Program Interface (API) that uses HTTP requests to GET, PUT, POST and DELETE data. It is how the front end of an application (think “phone app” or “website”) can communicate with the data store (think “database” or “file system”) https://developer.wordpress.org/rest-api/. request: wp_is_serving_rest_request() and wp_is_rest_endpoint(). Both functions should only be used after the parse_request action. A new 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. wp_is_rest_endpoint has been added to alter the return value of the wp_is_rest_endpoint() function. (42061)

Canonical

A new wp_admin_canonical_url filter hook is introduced to modify the admin canonical url value. (59545)

Editor

A new metadata global attribute has been added, which is needed for scenarios such as allowing the user to assign custom names to blocks, or for making 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. 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. work with user-modified templates/parts/patterns. (59797)

A new data field allowed_blocks that specifies block types has been added in block.json for block registration and REST API. (60403)

New video and audio pattern categories have been added for better organization of patterns. (60342)

A new setting allowCustomContentAndWideSize that disables layout content and wide size controls has been added to WP_Theme_JSON class. (60133)

Default duotone styles is allowed if not explicitly disabled in theme.json. (60136)

An aspect ratio dimensions.aspectRatio block support feature has been added, with support for both Group and Cover blocks. (60365)

Shadow block support via direct attribute has been replaced with support via style attribute instead. (60377)

The capability to parse CSSCSS Cascading Style Sheets. custom properties for fontSize and fontFamily has been added in WP_Style_Engine. (59982)

background-repeat has been added to the list of safe CSS properties for KSES. (60132)

viewStyle property has been added to block.json. This change brings block styles in parity with block scripts. (59673)

Pattern block’s overrides attribute data structure has been updated and renamed to content. (60456)

Asset registration file .asset.php has been made optional for blocks. (60460)

Support for deferred block variation initialization on the server has been added, which improves performance. The WP_Block_Type object has added a new property, variation_callback, which can be used to register a callback for building variation data only when the block variations data is needed. The WP_Block_Type::variations property has been made private. (59969)

Emoji

twitter/twemoji has been replaced with jdecked/twemoji v15.0.3, which adheres to the Unicode 15 spec and adds support for all Emoji introduced in Emoji 15.0. (57600)

General

$schema property has been added to block.json and theme.json files, which help ensure these files conform to expectations. (60255)

Media

Media icons are .svg by default: .png icon files in the media library have been replaced with .svg versions, which improves sharpness in different screen resolution devices. An argument for wp_mime_type_icon() to control the file type returned has been added. CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. usage now always returns an .svg file while maintaining backwards compatibility for any extended usage that expects a .png file. (31352)

Rest API

Terms can be assigned when creating attachments. (57897)

Information that is captured by the fatal error handler within a REST API request will now be provided when WP_DEBUG_DISPLAY is set to true. This additional data, appended under the new key error_data, can facilitate more thorough debugging for REST API errors. (60014)

Error handling in REST metaMeta Meta is a term that refers to the inside workings of a group. For us, this is the team that works on internal WordPress sites like WordCamp Central and Make WordPress. fields has been improved to collect all errors in a WP_Error object and continue execution after encountering the first error. This enhancementenhancement Enhancements are simple improvements to WordPress, such as the addition of a hook, a new feature, or an improvement to an existing feature. enables handling and displaying of multiple errors in a single response, which improves the debugging process. (48823)

original_source and author_text data fields have been added to the templates REST API. (60358)

Shortcodes

Shortcode_parse_atts() will now always return an array, which also improves developer experience as the return value does not have to be manually checked in the shortcodeShortcode A shortcode is a placeholder used within a WordPress post, page, or widget to insert a form or function generated by a plugin in a specific location on your site. itself. (59249)

Sitemaps

The “Last Modified” (lastmod) tagtag A directory in Subversion. WordPress uses tags to store a single snapshot of a version (3.6, 3.6.1, etc.), the common convention of tags in version control systems. (Not to be confused with post tags.) has been added for the individual posts and the homepage entries in the sitemap. (52099)

Themes

A new ‘theme_files‘ cache group, setup as a global cache group, has been added to block pattern caches. On a 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 networknetwork (versus site, blog), there will now be a single cache for block pattern data per theme, which allows block pattern caches to be shared between sites on a network and result in less repeated data in the object cache. (60120)

Users

Profile page color palettes:

On a user’s profile page, the color palette options are now displayed in <div> elements instead of tables.

Styles and scripts that target selectors such as table.color-palette or .color-palette td may need to be updated. To support WordPress versions both before and after this change, a 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-party can use the new .color-palette-shade class:

.color-palette td,
.color-palette-shade {
border-color: #fff;
}

Props to @sabernhardt for the dev 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..
(53157)

Props to @davidbaumwald for technical review, to @get_dave and @youknowriad for technical review (Editor), to @jorbin for technical/copy review.

#6-5, #dev-notes, #dev-notes-6-5