Dev Chat Summary, January 5, 2022

Meeting start on SlackSlack Slack is a Collaborative Group Chat Platform https://slack.com/. The WordPress community has its own Slack Channel at https://make.wordpress.org/chat/..

1. Welcome

Agenda

2. Announcements

Trunk is now open for 6.0-alpha, which means 6.0 is now underway!

WordPress 5.9 Release Candidate 1 is available.  Please download and test! You can reshare and encourage others to take part in testing RC1 on social media: TwitterFacebook.

Help test WordPress 5.9 features

Read the latest Developer Notes

3. Blogblog (versus network, site) posts to note

Post by @audrasjb: A year in core (December 29, 2021)

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/:

A Week in CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress.January 3, 2022 and December 27, 2021

Reminder of the revised 5.9 release schedule.

Join the discussion on 2022 release planning (December 27, 2021 post by @chanthaboune)

Proposal: Approving custom block pattern directory submissions (posted January 4, feedback by January 14, 2022)

If you’re wondering what performance improvements are slated for WordPress 5.9, @annezazu shares a post published today that gathers them all together. “Hope it helps get you excited about even speedier performance whether you’re writing a new post or hoping to improve the experience of visitors to your site.”

4. Update on the upcoming release

a) Update from @hellofromtonya

Thank you to everyone who contributed to 5.9! This is a big release with a lot of moving parts. Each you made it happen. Thank you! 

Let’s start with RC1 and what that means.

5.9 is now in the RC (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).) cycle. What does this mean? I gave a rundown of the main highlights in this message on Slack.

The biggies of what it means:

 A hard string freeze or a hard freeze is announced when all the strings of the upcoming release are frozen including the strings of the About page. A hard freeze is the final string freeze before a release.

  • Any changes to source code will require a dev-feedback keyword and 2 core committers review with the keyword dev-reviewed.

Focus during the remaining RC cycle is on any regressions or blockers that get reported.

The milestone itself has been cleared, meaning all tickets cleared both in Gutenberg and Core.

What remains then are new things reported (during the RC) and 2 tickets for the About and Dashboard Welcome. Everything else is either closed or punted to 5.9.1 or 6.0.

RC1 also means that trunk is now open for 6.0-alpha. For 6.0, tickets marked early can move forward and get committed for early feedback, testing, and soak time. This includes some of the work reverted in 5.9 that needed more time and were punted to 6.0.

What can you do in 5.9?
Test test test. And reach out into the community to encourage feedback, testing, and folks to update and prepare their themes and plugins for 5.9.

b) A request from both the marketing and training teams

Update from @webcommsat

Volunteers are needed to help with input and checking on social media posts on 5.9 release and to write/ update materials for Learn WordPress.

You can find more about what is needed for Training in this sprint post. Get involved through the Training Team Slack channel.

If you can help give input about features which could be highlighted in social media posts and feedback on what you would want to be sharing about 5.9, get involved through the Marketing Team’s Slack channel and work on this sheet. Please let Abha know and one of the Marketing Team will be able to help with links and access.

There are further marcomms and training joint sessions on the release taking place during the next two weeks. All dates are listed in the comments on today’s dev chat agenda or on this GitHub card.

5. Calls for volunteers

  • Test: help test the WordPress 5.9 RC1 – tips and how to above
  • Training Team: need urgent help to update/ produce materials on 5.9 for Learn WordPress (more details above)
  • Marketing Team: need dev input and your favorite features of 5.9 to incorporate into generic asocial media posts on the release (more details above)
  • Notetakers for the weekly developers chat in Core. Put your name down for a future week. There’s help available and another experienced core contributor will proof notes, so you’re not on your own.

Props to @webcommsat for the agenda and the notes, and @audrasjb for reviewing. Props to @marybaum @hellofromtonya and @webcommsat for facilitating dev chat.

#5-9, #dev-chat, #week-in-core

Bundled theme updates with WordPress 5.9

Besides creating the Twenty Twenty-Two theme, 30 tickets related to existing bundled themes have been closed as fixed during this 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. cycle. Below are some of the significant changes.

When a page is set as the site’s Privacy Policy, a link to it is now automatically added to the footer in both Twenty Twenty and Twenty Twenty-One.

Privacy Policy link displays below copyright on smaller screens
Twenty Twenty (600 pixels wide)
Privacy Policy link displays below site title on smaller screens
Twenty Twenty-One (600 pixels wide)

With Twenty Twenty, the “Powered by WordPress” link displays on screens 1,000 pixels or wider. This had shown at the 700-pixel breakpoint, but the change helps reduce the possibility that footer content wraps across two lines.

Privacy Policy link displays between copyright and powered-by link on larger screens in Twenty Twenty
Twenty Twenty (1200 pixels wide)
Privacy Policy link displays beside the powered-by link on larger screens in Twenty Twenty-One
Twenty Twenty-One (1200 pixels wide)

TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. tickets: #53446 (Twenty Twenty) and #53445 (Twenty Twenty-One)

These themes had used the WhatsApp icon for links in the social 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. that include the whatsapp.com domain. Now the icon also appears for links with the preferred wa.me domain.

WhatsApp icon in Twenty Seventeen social navigation
Twenty Seventeen
WhatsApp icon in Twenty Twenty social navigation
Twenty Twenty

Trac tickets: #51946 (Twenty Seventeen) and #50542 (Twenty Twenty)

Comment form required fields

When logged in, Twenty Nineteen and Twenty Twenty-One now have the default logged-in-as links and required fields message:

Logged in as [username]. Log out? Required fields are marked *

Comment form lacked required fields message in Twenty Nineteen
Twenty Nineteen
(before)
Required fields message will be included in Twenty Nineteen
Twenty Nineteen
(with links and message)
Comment form lacked required fields message in Twenty Twenty-One
Twenty Twenty-One
(before)
Required fields message will be included in Twenty Twenty-One
Twenty Twenty-One
(with links and message)

Improving required field indicator styling

In previous versions of Twenty Eleven, the star character to signify required comment form fields could overlap the text in some languages. In addition to removing the absolute positioning that caused the overlap, this revision makes the star’s styling more consistent between the input labels and the comment notes paragraph.

Comment field was not marked as required
Logged in, before
Comment field is required, with red indicator in Comment label and required fields message
Logged in, after
Comment field was not marked as required, but Name and Email fields had red indicator
Logged out, before
Comment field is marked as required, and all indicators are red
Logged out, after

Trac tickets: #54392 (Twenty Nineteen and Twenty Twenty-One) and #54408 (Twenty Eleven)

Additional updates for Twenty Seventeen

HeaderHeader The header of your site is typically the first thing people will experience. The masthead or header art located across the top of your page is part of the look and feel of your website. It can influence a visitor’s opinion about your content and you/ your organization’s brand. It may also look different on different screen sizes. image alternative text

The header image’s alternative text is customizable with WordPress 5.9, and the default alt attribute is empty instead of the site title. If the image conveys meaning to people who do not see it, you can go to the Media Library—after uploading and assigning it as the header image—and compose the alternative text there. (Writing alt text within the upload dialog does not yet save to the new image.)

RSS WidgetWidget A WordPress Widget is a small block that performs a specific function. You can add these widgets in sidebars also known as widget-ready areas on your web page. WordPress widgets were originally created to provide a simple and easy-to-use way of giving design and structure control of the WordPress theme to the user. icon position

In right-to-left languages, the legacy RSS widget (with Classic Widgets) now positions the feed icon on the left side of the feed title. In other languages, the icon has floated to the right side, and this change mirrors that layout.

RSS feed icon floats to the left for right-to-left languages

Trac tickets: #46124 (header image) and #52224 (RSS widget)

Since the first version of Twenty Twenty-One, the feed icon beside the classic/legacy RSS widget title has been hidden, which resulted in an invisible link.

Using the rss_widget_feed_link 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. introduced in WordPress 5.9, the theme disables the output of the icon and its link. The visible text heading (the feed title) is still linked.

Trac ticketticket Created for both bug reports and feature development on the bug tracker.: #52880

Removing 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) landmark role attributes

With modern browsers, assistive technologyAssistive technology Assistive technology is an umbrella term that includes assistive, adaptive, and rehabilitative devices for people with disabilities and also includes the process used in selecting, locating, and using them. Assistive technology promotes greater independence by enabling people to perform tasks that they were formerly unable to accomplish, or had great difficulty accomplishing, by providing enhancements to, or changing methods of interacting with, the technology needed to accomplish such tasks. https://en.wikipedia.org/wiki/Assistive_technology does not require attributes such as role="navigation" to recognize several HTML5 elements’ native ARIA role. The role attribute is only necessary when an element does not have a native role.

These native roles have been removed from bundled themes:

  • role="banner" for <header> elements
  • role="navigation" for <nav> elements
  • role="main" for <main> elements
  • role="contentinfo" for most <footer> elements
  • role="complementary" for <aside> elements

Note: Twenty Twelve continues to include <footer role="contentinfo"> to maintain the styling, particularly if a child themeChild theme A Child Theme is a customized theme based upon a Parent Theme. It’s considered best practice to create a child theme if you want to modify the CSS of your theme. https://developer.wordpress.org/themes/advanced-topics/child-themes/. edits the markup but uses the original stylesheet’s selectors.

Trac tickets: #54054 (navigation) and #54079 (other roles)

When clicking “Continue reading” or “Skip to content” links, a header fixed to the top of the page can cover where that content starts. Likewise, the border for Twenty Sixteen needs a slight offset.

WordPress 5.9 includes a --wp-admin--admin-bar--height CSSCSS Cascading Style Sheets. variable and uses scroll padding to compensate for the adminadmin (and super admin) toolbar when it shows. Now, three bundled themes add the height of their headers to that offset value:

  • Twenty Fourteen (48 pixels)
  • Twenty Sixteen (21 pixels)
  • Twenty Seventeen (72 pixels)

Twenty Fourteen had a solution for the “Read more” links, which is now replaced by the more thorough option.

Trac tickets: #46371 (scroll padding for anchor links) and #52623 (CSS variable)


Thanks @audrasjb and @annezazu for reviewing.

#5-9, #bundled-theme, #dev-notes

WordPress 5.9 Performance Improvements

Thank you to @aristath @piyopiyofox @bph @mkaz @flixos90 @youknowriad who helped review this post. 

Whether you’re using the latest and greatest with full site editing features or not, there are performance enhancements that everyone can look forward to with WordPress 5.9 set to launch January 25th, 2022. At a high level, you can expect improvements to the Inserter, 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. Themes, List View, and more. 

Editor performance

This section touches on the actual experience of creating content within the editor itself. Does the Inserter open quickly, allowing you to snag what you need? Does using List View feel smooth and snappy? These are the kinds of experiences that have been focused on and improved for 5.9. 

Inserter 

The Inserter is a very commonly used tool in the editing experience that allows you to select any block or pattern you’d like to build with. As the number of blocks and patterns grow, the Inserter needs to be able to keep up to make it easy to add what you need. To aid in usability, lazy render has been applied to the Inserter in two instances: when searching block types and patterns, and when displaying categories. 

By lazy-rendering search results, the initial results are provided faster when you search. With the same lazy-rendering approach applied to categories, they now render one by one. Both improvements allow the browser to do higher priority things and ensure a better experience (like actually opening the Inserter quickly) before continuing to take care of other processes, like displaying categories. 

Reusable Blocks

For larger sites with lots of reusable blocks, saved reusable blocks are now significantly faster when a site has thousands of them. This helps fulfill the promise of WordPress growing with you. The coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. of this improvement was achieved by implementing a method that extracts the tokenizer regular expression used in package block-serialization-default-parser, and uses it to match the very first block boundary found in a reusable block’s markup.

List View

List View is an increasingly used tool to help folks navigate complex content with ease. A big part of ensuring it can be done with ease comes down to performance considerations, especially if you have a large amount of content in a page or template. When we say large, we mean it–we tested posts with 10,000 blocks. Thanks to a windowing technique that now renders a fixed number of items at a time instead of every block, the enhanced List View continues to scale as your content does. 

Front end performance

This section touches on site visitor experience and the resulting impact on SEO. Does your site render quickly? Is only what’s necessary loaded as needed? What can one do as 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 or theme author to ensure solid performance? While loads of things impact front end performance, there are quite a few enhancements coming to WordPress 5.9 that focus on these kinds of questions: 

Block Themes

If you’re using a Block Theme, you’ll be able to take advantage of enhanced site performance thanks to theme.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. enqueuing all styles from one place as a “global stylesheet”. This will reduce the amount of CSSCSS Cascading Style Sheets. shipped with a theme and result in fewer specificity wars.

Block Stylesheets & CSS Loading

In previous releases, all styles for all blocks were enqueued in a single file, leading to extra page load. With the 5.9 release, only what’s necessary is loaded when viewing content due to improvements that inline tiny stylesheets, and a tweak to only load a block’s CSS styles if the block exists on the page. Further, IE polyfills were removed from block front-facing scripts to reduce their size. By cutting down on the amount of CSS loaded, the 5.9 release increases performance and decreases loading time dramatically. 

Add additional stylesheets on a per-block basis to reduce CSS impact

Block and theme developers can now add additional stylesheets on a per-block basis instead of loading monolithic stylesheets– further reducing the CSS impact on a page. For Block developers, this allows for complex blocks to reuse styles they need from other blocks without the need to duplicate those same styles. For theme developers, you can now use a new wp_enqueue_block_style() function that allows you to register stylesheets on a per block basis to reduce any unnecessary styles loading. Here’s a dev note with more information.

Improvements to Lazy Loading images

Building on the excellent work to implement lazy loading images in WordPres 5.5, performance improvements are coming baked into WordPress 5.9 without needing any extra efforts from developers. At the core of this change is that WordPress will now skip the very first “content image or iframeiframe iFrame is an acronym for an inline frame. An iFrame is used inside a webpage to load another HTML document and render it. This HTML document may also contain JavaScript and/or CSS which is loaded at the time when iframe tag is parsed by the user’s browser.” on the page from being lazy-loaded. As you can see in the comprehensive dev note that details this change, “an analysis taking into account 50 popular themes showed that the enhancementenhancement Enhancements are simple improvements to WordPress, such as the addition of a hook, a new feature, or an improvement to an existing feature. brought LCP improvements across the board, up to 30% faster page load”

What do the numbers show? 

Numbers help paint a picture that words can’t always. Below is a snapshot of this release where you’ll see decreased loading times in a variety of editor areas, with only two gaining nominal loading time increases in the build.

FeatureDescriptionWP 5.6WP 5.7WP 5.8WP 5.9Diff
LoadingTime to first block (ms)3311.884773.943457.623184.38-8.23%
TypingTime to type a character (ms)54.2564.2453.6341.52-25.45%
Block selectionTime to select a block (ms)78.2166.5689.82101.89+12.59%
Inserter openingTime to open the global inserter (ms)98.91124.21134.8637.87-112.30%
SearchTime to type in the inserter search input (ms)38.8669.46124.1173.26-51.53%
HoverTime to move the mouse between two block items in the inserter (ms)37.7924.7923.5226.23+10.90%

If you’re interested in improving performance in WordPress, join the performance meetings, review the current performance related Trac and Gutenberg issues, help with the performance plugin, and test everything with performance considerations in mind.

#5-9, #core-editor, #performance

What’s new in Gutenberg 12.3? (5 January)

“What’s new in 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/…” posts (labeled with the #gutenberg-new tag) are published following every Gutenberg release on a biweekly basis, discovering new features included in each release. As a reminder, here’s an overview of different ways to keep up with Gutenberg and the Full Site Editing project.


Gutenberg 12.3 has just been released and is available to download, making it the first Gutenberg release of 2022!

This release contains fewer contributions than usual due to the holiday season that took place in some parts of the world in the last two weeks. However, it still has many important contributions, which is an excellent reminder of WordPress’ contributor diversity. Let’s dive into some of them.

Table of contents

New blocks to build with

We have three brand new blocks at our disposal.

Author Name 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.

As part of an effort to split the Post Author block into separate blocks to allow for even more layout options, the Author Name block has been released. This means you will have extra options to customize the author name to your liking.

Post Author Name

More atomic author-related blocks will follow in the future, like Author AvatarAvatar An avatar is an image or illustration that specifically refers to a character that represents an online user. It’s usually a square box that appears next to the user’s name. or Author Bio.

Comments pagination: Next and Previous blocks

Continuing with the work that has been done on the Comments Query Loop blocks in previous Gutenberg releases, the Comments Next Page and Comments Previous Page blocks have been released.

They are the counterparts of the Next Page, and Previous Page blocks of the Query Loop, but built for the Comments Query LoopLoop The Loop is PHP code used by WordPress to display posts. Using The Loop, WordPress processes each post to be displayed on the current page, and formats it according to how it matches specified criteria within The Loop tags. Any HTML or PHP code in the Loop will be processed on each post. https://codex.wordpress.org/The_Loop.. They display links to navigate the comments forward and backward when not all of the comments are shown on the current page.

Comments Previous and Next Page

With the release of these two blocks, we conclude all the planned inner blocks for the Comments Query Loop. However, work on the Comments Query Loop blocks has not finished yet: more improvements are in the works.

More controls to customize

Blocks keep getting more powerful and this release is no exception.

Spacer block: custom units

Custom units can now be used to configure the Spacer block:

  • EM: Relative to parent font size
  • REM: Relative to root font size
  • VH: Viewport width
  • VW: Viewport height
Custom Units in the Spacer block

Group block: gap support & typography support

The Group block can now use the new Gap support, which adds the ability to choose the distance between the children items of the block.

This new gap setting is also available in the Row variation (added in Gutenberg 11.5), except that the gap is added horizontally instead of vertically. This allows you to have even more options to customize the layout to your liking.

Typography was added to the Group/Row blocks. This can come in handy when you need to define the typography settings for a whole section, like a sidebarSidebar A sidebar in WordPress is referred to a widget-ready area used by WordPress themes to display information that is not a part of the main content. It is not always a vertical column on the side. It can be a horizontal rectangle below or above the content area, footer, header, or any where in the theme., and you don’t want to duplicate the same typography settings over multiple blocks.

Set your site icon using the Site Logo block

There is now a new option in the Site Logo block settings to sync the site icon* to the Site Logo image. When the toggle is switched on, any updates made to the Site Logo block image are also applied to the site icon. This is an important flow that allows for parity between the Site Editor experience and the CustomizerCustomizer Tool built into WordPress core that hooks into most modern themes. You can use it to preview and modify many of your site’s appearance settings..

* Site icons are what you see in browser tabs, bookmark bars, and within the WordPress mobile apps.

Set site icon with Site Logo settings

Restrict 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. creation for non-adminadmin (and super admin) users

From now on, only admins can create Navigation Menus. This matches the current menu system in WordPress.

When non-admin users add a Navigation block, they will now see a warning telling them they do not have permission to create Navigation Menus and instead will be presented with the option to select an existing one. This allows folks to still add navigation to their content in line with broader WordPress permissions.

Restrict Navigation Menu creation for non-admin users
Non-admin users can still add a Navigation block and select an existing menu.
If non-admin users create a menu, changes won't be saved
If a non-admin user tries to create a menu, changes won’t be saved.

CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. Blocks Reference

There is a new Handbook page that lists all the core blocks included in the Gutenberg 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. It contains the name, description, categoryCategory The 'category' taxonomy lets you group posts / content together that share a common bond. Categories are pre-defined and broad ranging., supports, and attributes of each block and it is generated automatically using their 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. properties. This resource makes it easier for anyone who wants to extend or customize the core blocks.

Core Blocks Reference section in the Handbook

Changelog

These are all the changes included in this release.

Features

Block Library

  • Group/row blocks:
    • Add Gap support. (37459)
    • Add Typography support. (37456)
  • New Author Name block. (36001)
  • Comments Pagination:
    • New Comments Pagination Next block. (36562)
    • New Comments Pagination Previous block. (36912)

Enhancements

Block Library

  • Navigation:
    • Enable an even more compact setup state. (37089)
    • Use rems for padding. (37478)
  • Site Logo: Add option to set site icon from Site Logo block. (35892)
  • Paragraph: Add font family support. (37586)
  • Comments Template: Add comments pagination. (37610)
  • Embeds: Simplify the embed loading state. (37548)
  • Spacer: Add custom units for height and width. (36186)

Global Styles

  • Make the global styles subtitles font smaller. (37600)
  • Add support for nameless font sizes. (37410)

Colors

  • Allow color gradient popover to be above the color toggle. (37430)
  • Make color style labels simpler. (37493)
  • Use subtitle styles for the palette names. (37460)

Design Tools

  • Border panel: Collapse color controls. (37425)

Document Settings

  • Add class name to post author on edit post sidebar. (36269)

Site Editor

  • Update save panel’s cancel button from icon to visible text. (37310)

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)

  • Latest Posts: Add aria-label to featured links. (36251)

Bug Fixes

Block Library

  • Navigation:
    • Restrict Navigation permissions and show UIUI User interface warning if cannot create. (37454)
    • Ensure the overlay menu works when inserting navigation block patterns and that inner blocks are retained. (37358)
    • Fix navigation appender. (37447)
    • Revert all margins on navigation-item in the editor. (37587)
    • Fix page list issues in the overlay. (37444)
    • Show a UI warning when the user does not have permission to update/edit an existing Navigation block. (37286)
    • Try cascading nav styles through class names. (37473)
  • Query Loop:
    • Fix editable post blocks in Query Loop with zero queryId. (37629)
    • Changed the letter case for Post Type to Post type. (37499)
    • Query Pagination Next: Hide block if the custom query has no results. (37553)
    • Revert Query Pagination Next/Previous placeholder(36681). (37520)
  • Site Logo: Fix block alignment issues. (36627)
  • Gallery: Fix block registration hook priority. (37409)
  • Post Content/Title: Reflect changes when previewing a post. (37622)
  • Post ExcerptExcerpt An excerpt is the description of the blog post or page that will by default show on the blog archive page, in search results (SERPs), and on social media. With an SEO plugin, the excerpt may also be in that plugin’s metabox.: Specify paragraph as post excerpt 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.) name. (37412)
  • Reusable Block: Fix embed handling. (37554)
  • Site icon: Fix site icon styling to display non-square site icons within a square button. (37570)
  • Template Part: Only display a missing notice in debug mode. (37404)
  • ServerSideRender: Fix loading state. (37623)
  • Comments Avatar Block: Show avatar drag handles only when selected. (37567)

Global Styles

  • Color editor discards colors with the default name. (37496)
  • Gradients are not being applied by class. (37597)
  • Impossible to edit the theme and default colors. (37497)
  • Blank site editor when theme name contains a period. (37167)
  • Lower the specificity of font-size CSSCSS Cascading Style Sheets. Custom Properties in the editor. (37526)
  • Use inset shadow on color indicators and adjust spacing. (37500)

Block Editor

  • Fix Enter handling for nested blocks. (37453)
  • Restrict delete multi-selected blocks shortcut. (37595)
  • Avoid using CSS variables for block gap styles. (37360)

Themes

  • Add comment-form and comment-list to default html5 theme support. (37536)
  • Avoid Duplicated “Theme File Editor” menu. (37592)
  • Fix conditional check “Theme File Editor” menu. (37616)
  • Fix duotone theme cache. (36236)

Template Editor

  • Avoid undoing issues when resetting parent blocks for controlled blocks. (37484)
  • Change the color of the welcome dialog close icon, so it is visible against a black background. (37435)
  • Template Editing Mode: Fix options dropdown. (37442)
  • Try to fix auto-resizing in template part focus mode. (37394)
  • Update the template list action labels. (37576)

Site Editor

  • Add customized indicators to plugin templates that have been customized. (37329)
  • Register block editor shortcuts. (37577)
  • Update regex to handle 404 template slug. (37579)
  • Parse 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. blocks outside the content. (37545)

Accessibility

  • Editor: Focus when navigation toggle receives state false. (37265)
  • Navigation: Only add dialog role when modal is open. (37434)

npm Packages

  • Fix missing peer dependencies where ReactReact React is a JavaScript library that makes it easy to reason about, construct, and maintain stateless and stateful user interfaces. https://reactjs.org/. is used indirectly. (37578)

Testing

  • Fix flaky Navigation block end-to-end test by mocking out URLURL A specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org details endpoint to avoid 404. (37501)

Post Editor

  • Multi-entity saving: Allow publishing a post while not saving changes to non-post entities. (37383)

Components

  • ToolsPanel: Allow items to register when panelId is null. (37273)

Design Tools

  • Make block support tools panels compatible with multi-selection. (37216)

Documentation

Packages

  • Add automated core blocks documentation. (36183)
  • Added README for GradientPicker. (37614)
  • Add a link to 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.-block example in gutenberg-examples repo. (37633)
  • Fix parameter type in the render function of file block. (36262)
  • Add changelog entry for __experimentalIsRenderedInSidebar gradient components flag. (37457)

Handbook

  • Switch code distinction to JSX & Plain. (37348)
  • Fix a grammatical error in the Create Block tutorial. (37636)
  • Fix plugin sidebar tutorial not publishing. (37505)
  • Update plugin sidebar to new how to guide template. (37490)
  • Update “Local by Flywheel” name and URL. (37512)
  • Update Meta Boxes to a single page how to guide. (37621)

Code Quality

Compatibility with Core

  • Adds missing block template class properties. (37556)

Formatting

  • Fix lint issues. (37618)
  • Move block patterns compatibility code to lib/compat folder. (37451)

Packages

  • Data:
    • Block top level useSetting paths. (37428)
    • Deprecate receiveUploadPermissions. (37508)

Site Editor

  • Remove dead code. (37581)

Components

  • Storybook: Tweak configuration for v6.4 update. (37544)

Security

Tools

Testing

  • End to end:
    • Switch to using a $eval to fill user creation fields. (37469)
    • Fix and enable remaining navigation block end-to-end tests. (37437)
    • Add block editor shortcuts end-to-end tests. (37624)

Build Tooling

  • Add npm-run-all package to simplify running scripts. (37558)
  • Update caniuse to latest. (37588)
  • Fix pre-commit hook to build block documentation. (37613)

Performance Benchmark

Post Editor

VersionTime to first blockKeypress event
Gutenberg 12.36.7 s50 ms
Gutenberg 12.26.7 s49 ms
WordPress 5.86.9 s53 ms

Site Editor

VersionTime to first blockKeypress event
Gutenberg 12.36.7 s41 ms
Gutenberg 12.26.7 s43 ms
WordPress 5.84.3 s12 ms

Time to first block: firstBlock
Keypress event: type


Thank you, @gziolo and @annezazu for helping me with the release process, proofreading this post, and helping to select the release highlights.

Thank you, @javiarce for creating the assets included in this post.

And finally, thanks to all those who contributed to this release!

#block-editor, #core-editor, #gutenberg, #gutenberg-new

Proposal: Changes to JavaScript Coding Standards for Full Prettier Compatibility

I propose switching to the original version of the Prettier code formatting tool in 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/ project and updating it to the most recent 2.5 version. Consequently, we should apply the necessary changes to the existing WordPress JavaScript Coding Standards around spacing to respect Prettier’s capabilities.

Code formatting challenges

It’s worth reminding that this topic was discussed several times, beginning in 2017 when the initial exploration of using Prettier started with WordPress/gutenberg#2819. Throughout all that time, the Prettier maintainers didn’t change their mind about adding support for spaces between parens (()) and brackets ([]) despite many requests shared in prettier/prettier#1303 from users (including the WordPress community). That’s why we decided to apply the first batch of JavaScript Coding Standards revisions two years later to use the forked version of Prettier developed by developers at Automattic. It allowed us to remain aligned with the coding style conventions used for PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 5.6.20 or higher in the WordPress codebase. In particular, to follow these rules:

Use spaces liberally throughout your code. “When in doubt, space it out.”

The WordPress JavaScriptJavaScript JavaScript or JS is an object-oriented computer programming language commonly used to create interactive effects within web browsers. WordPress makes extensive use of JS for a better user experience. While PHP is executed on the server, JS executes within a user’s browser. https://www.javascript.com/. standards prefer slightly broader whitespace rules than the jQuery style guide. These deviations are for consistency between the PHP and JavaScript files in the WordPress codebase.

The issue is that we ended up with an outdated fork of Prettier in the Gutenberg project that didn’t get any updates for more than a year. The only motivation behind using a custom version of Prettier remains its additional functionality overriding formatting behavior for spaces around parens and brackets. In the meantime, there were three minor releases of Prettier with a long list of new features in the last year:

The Gutenberg project no longer uses only JavaScript for development. Some parts of the codebase use TypeScript, which we agreed upon a few months back. It means we can’t use improvements added for newer versions of the TypeScript language and potentially for future additions to the JavaScript language. A deprecation was also added to one of the config options we use in the shared Prettier config that the community uses. It turns out that it prevents using the @wordpress/prettier-config package with the most recent version of Prettier in 3rd party projects, as explained in WordPress/gutenberg#37516. Finally, we had multiple reports in WordPress/Gutenberg#21872 from the community members using @wordpress/scripts or @wordpress/eslint-plugin packages that the forked version of Prettier doesn’t install correctly in their projects. The good news is that switching to the original Prettier will resolve all of the above!

It quickly became noticeable that the automatic code formatting saves you so much time and energy when trying to keep a consistent coding style in the project. This is why we also started using Prettier to format other types of files it supports in the Gutenberg project, like 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., YAML, Markdown. We also consider doing the same for CSSCSS Cascading Style Sheets. and SCSS next.

RevisionsRevisions The WordPress revisions system stores a record of each saved draft or published update. The revision system allows you to see what changes were made in each revision by dragging a slider (or using the Next/Previous buttons). The display indicates what has changed in each revision. to JavaScript Coding Standards

I propose we apply all the necessary changes to the WordPress JavaScript Coding Standards to switch to the latest available version of Prettier (2.5 as of writing). The excerptExcerpt An excerpt is the description of the blog post or page that will by default show on the blog archive page, in search results (SERPs), and on social media. With an SEO plugin, the excerpt may also be in that plugin’s metabox. of the most significant revisions is included below.

-Some whitespace rules differ, for consistency with the WordPress PHP coding standards.
+Some whitespace rules differ, for consistency with the [Prettier](https://prettier.io) formatting tool.
-All new or updated JavaScript code will be reviewed to ensure it conforms to the standards, and passes JSHint.
+All new or updated JavaScript code will be reviewed to ensure it conforms to the standards, and passes [ESLint](https://eslint.org).
-Use spaces liberally throughout your code. “When in doubt, space it out.”
-Any ! negation operator should have a following space.*
+Any ! negation operator should not have a following space.
-Always include extra spaces around elements and arguments:
-array = [ a, b ]; 
-foo( arg );
-foo( 'string', object );
-foo( options, object[ property ] );
-foo( node, 'property', 2 );
-prop = object[ 'default' ];
-firstArrayElement = arr[ 0 ];
+Never include extra spaces around elements and arguments: 
+arg = [a, b]; 
+foo(arg);
+foo('string', object);
+foo(options, object[property]);
+foo(node, 'property', 2);
+prop = object['default'];
+firstArrayElement = arr[0];
-var i;
-
-if ( condition ) {
-   doSomething( 'with a string' );
-} else if ( otherCondition ) {
-    otherThing( {
-        key: value,
-        otherKey: otherValue
-    } );
-} else {
-    somethingElse( true );
-}
- 
-// Unlike jQuery, WordPress prefers a space after the ! negation operator.
-// This is also done to conform to our PHP standards.
-while ( ! condition ) {
-    iterating++;
-}
- 
-for ( i = 0; i < 100; i++ ) {
-    object[ array[ i ] ] = someFn( i );
-    $( '.container' ).val( array[ i ] );
-}
- 
-try {
-    // Expressions
-} catch ( e ) {
-    // Expressions
-}
+var i;
+
+if (condition) {
+	doSomething('with a string');
+} else if (otherCondition) {
+	otherThing({
+		key: value,
+		otherKey: otherValue,
+	});
+} else {
+	somethingElse(true);
+}
+ 
+while (!condition) {
+	iterating++;
+}
+
+for (i = 0; i < 100; i++) {
+	object[array[i]] = someFn(i);
+	$('.container').val(array[i]);
+}
+
+try {
+	// Expressions
+} catch (e) {
+	// Expressions
+}

You can preview the impact on the Gutenberg codebase on GitHubGitHub GitHub is a website that offers online implementation of git repositories that can 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/ in the exploratory Pull Request. The same changes would impact the tooling recommended for 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. development like @wordpress/create-block and @wordpress/scripts.

When will a decision be made?

Let’s plan for making a decision three weeks from the date of publication of this post. That should give enough time for discussion and questions.

#coding-style, #codingstandards, #javascript

New Capability Queries in WordPress 5.9

WordPress 5.9 adds support for capability queries in WP_User_Query. Similar to the existing role/role__in/role__not_in query arguments, this adds support for three new query arguments in WP_User_Query:

  • capability
  • capability__in
  • capability__not_in

These can be used to fetch users with (or without) a specific set of capabilities, for example to get all users with the capability to edit a certain post type.

A new capabilities parameter (mapping to capability__in in WP_User_Query) was added to the 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/. users controller so you can also perform these queries via the REST API.

Under the hood, this will check all existing roles on the site and perform a LIKE query against the capabilities user 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. field to find:

  • all users with a role that has this capability
  • all users with the capability being assigned directly

Important note: In WordPress, not all capabilities are stored in the database. Capabilities can also be modified using filters like map_meta_cap. These new query arguments do not work for such capabilities.

The prime use case for capability queries is to get all “authors”, i.e. users with the capability to edit a certain post type. This is needed for the post author dropdown in the post editor, for instance.

Until now, 'who' => 'authors' was used for this, which relies on user levels. However, user levels were deprecated a long time ago and thus never added to custom roles. This led to constant frustration due to users with custom roles missing from author dropdowns.

Thanks to this new feature, any usage of 'who' => 'authors' in coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. was updated to use capability queries instead.

Subsequently, 'who' => 'authors' queries were deprecated in favor of these new query arguments. The same goes for ?who=authors queries for thewp/v2/users REST API endpoint.

In the same run, the twentyfourteen_list_authors() function in the Twenty Fourteen theme was updated to make use of this new functionality, adding a new twentyfourteen_list_authors_query_args 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. to make it easier to override this behavior.

Making use of capability queries while retaining compatibility for older WordPress versions, one could use code as follows to support both:

$args = array(
	'orderby'    => 'post_count',
	'order'      => 'DESC',
	'capability' => array( 'edit_posts' ),
);

// Capability queries were only introduced in WP 5.9.
if ( version_compare( $GLOBALS['wp_version'], '5.9-alpha', '<' ) ) {
	$args['who'] = 'authors';
	unset( $args['capability'] );
}

$authors = get_users( $args );

To learn more about this change and the 11-year-old 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. it fixed, check out #16841, [51943], and [52290]

#5-9, #dev-notes

Dev Chat agenda for January 5, 2021

The weekly developers chat meeting will be held at 20:00 UTC in the #core channel on Slack. All welcome.

Summary from the last dev chat meeting.

1. Welcome

2. Announcements

Trunk is now open for 6.0-alpha, which means 6.0 is now underway!

WordPress 5.9 Release Candidate 1 is available.  Please download and test! You can reshare and encourage others to take part in testing RC1 on social media: Twitter, Facebook.

Help test WordPress 5.9 features

Read the latest Developer Notes

3. Blogblog (versus network, site) posts to note

A year in core (December 29, 2021)

What’s new in Gutenberg 12.2? (December 22, 2021). Gutenberg 12.2 release (5 January 2022)

A Week in CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress.: January 3, 2022 and December 27, 2021

The revised 5.9 release schedule.

Join the discussion on 2022 release planning (December 27, 2021 post by @chanthaboune)

Proposal: Approving custom block pattern directory submissions (posted January 4, feedback by January 14, 2022)

Do you have other posts that should get attention in the weekly dev chat? Please add them in the comments.

4. Upcoming releases

@hellofromtonya will share an update on the 5.9 release, slated for January 25, 2022.

Component Maintainers

From now until 5.9 launch, devchat will skip a formal check-in so the group can have a longer Open Floor. If you’re a maintainer who would like to get help with a blockerblocker A bug which is so severe that it blocks a release. or share success/ collaboration, please feel free to either comment on this post or in the meeting.

Open Floor

You can add your topic to the comments below.

#agenda#core#dev-chat#week-in-core

#5-9, #agenda, #dev-chat

X-post: Block-based Themes Meeting Agenda: January 5, 2022

X-post from +make.wordpress.org/themes: Block-based Themes Meeting Agenda: January 5, 2022

Performance team meeting summary 4 January 2022

Meeting agenda here and the full chat log is available beginning here on Slack.

Focus group updates

Images

@adamsilverstein

GitHub project

  • @adamsilverstein offline
  • @mitogh: Tested current functionality and opened several issues from testing (will clean up today); will begin work on a doc for planning the migrationMigration Moving the code, database and media files for a website site from one server to another. Most typically done when changing hosting companies. of existing images to webp.

Feedback requested

  • N/A

Object caching

@tillkruess @dustinrue

GitHub project

  • @tillkruess: Work in progress on a better Health Check suggestion for object caching, but haven’t pushed anything new yet. Splitting up all WP_Object_Cache improvements in GitHubGitHub GitHub is a website that offers online implementation of git repositories that can 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/ to make each a distinct issue.

Feedback requested

  • N/A

Site Health

@audrasjb

GitHub project

Feedback requested

Measurement

@wp-source @josephscott

GitHub project

Feedback requested

JavaScriptJavaScript JavaScript or JS is an object-oriented computer programming language commonly used to create interactive effects within web browsers. WordPress makes extensive use of JS for a better user experience. While PHP is executed on the server, JS executes within a user’s browser. https://www.javascript.com/.

@aristath

GitHub project

Feedback requested

  • N/A

Infrastructure

Feedback requested

Open floor

  • @blogaid asked about testing image changes; @mitogh shared the repo link and @shetheliving confirmed that testing can be done via the 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 and image-related feedback should be shared on the WebP for uploads PR

#core-media, #meeting, #performance, #performance-chat, #summary

Miscellaneous Core changes in WordPress 5.9

WordPress 5.9 brings a lot of smaller changes that developers should know about. Here’s a breakdown.

Comment text field now marked as required

With WP 5.9, a required asterisk is added to the comment text field. Historically, the name and email fields were marked as required, but the comment text field was not, though it was actually a required field.

Please note this change also adds a container to the comment required text sentence, with the required-field-message class.

If the theme (or 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) creates a custom logged_in_as or comment_notes_before message, this could result in having the asterisk character indicate the required Comment field without a “Required fields are marked *” explanation. For example, Twenty Nineteen and Twenty Twenty-One had removed the logged_in_as text by setting it to null, so the default text has been restored to display the required fields message (with the links).

Also, if a theme styles the indicator character specifically for the Name and Email field labels—as Twenty Eleven had done—those styles should apply to the Comment field label as well.

For more information, see TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. ticketticket Created for both bug reports and feature development on the bug tracker. #16206 and related commits: [52029], [52149], [52200].

Two new oEmbed providers: Wolfram Notebook and Pinterest

All of the Wolfram services are tied together by the Wolfram Language: Notebooks are their hosted version of Wolfram Language based documents. Their oEmbed 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. is based on the following URLURL A specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org scheme: https://www.wolframcloud.com/oembed. There is also a secondary endpoint that returns the embed wrapped in an iframeiframe iFrame is an acronym for an inline frame. An iFrame is used inside a webpage to load another HTML document and render it. This HTML document may also contain JavaScript and/or CSS which is loaded at the time when iframe tag is parsed by the user’s browser.: https://www.wolframcloud.com/oembed/iframe/.

For more information, see Trac ticket #53326.

Pinterest provides a single oEmbed endpoint, which handles URLs of pins, boards, and profiles: https://www.pinterest.com/oembed.json.

For more information, see Trac ticket #53448.

KSES: Add options for restricting tags based upon their attributes

This change adds two now attribute-related config options to KSES:

  • An array of allowed values can be defined for attributes. If the attribute value doesn’t fall into the list, the attribute will be removed from the 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.).
  • Attributes can be marked as required. If a required attribute is not present, KSES will remove all attributes from the tag. As KSES doesn’t match opening and closing tags, it’s not possible to safely remove the tag itself, the safest fallback is to strip all attributes from the tag, instead.

Allow PDFs to be embedded as objects

Included with this change is an implementation of these options, allowing the <object> tag to be stored in posts, but only when it has a type attribute set to application/pdf.

This implementation also introduces the _wp_kses_allow_pdf_objects callback function, which is used to check if a PDF URL is safe.

For more information, see ticket #54261.

Remove role="navigation" from <nav> elements

According to HTML5 documentation, adding role="navigation" to a <nav> element is unnecessary. It should only be added to elements like <div> instead, when using the semantically correct <nav> is not possible.

Historically, role="navigation" was required for assistive technologyAssistive technology Assistive technology is an umbrella term that includes assistive, adaptive, and rehabilitative devices for people with disabilities and also includes the process used in selecting, locating, and using them. Assistive technology promotes greater independence by enabling people to perform tasks that they were formerly unable to accomplish, or had great difficulty accomplishing, by providing enhancements to, or changing methods of interacting with, the technology needed to accomplish such tasks. https://en.wikipedia.org/wiki/Assistive_technology to recognize HTML5 element’s native ARIA roles while HTML5 and ARIA were being introduced. With the deprecation of IE11, the role attribute is only required when mapping elements that don’t have native role.

This change removes the navigation role from the following items:

  • All the legacy navigation widgets
  • All the bundled themes from Twenty Eleven to Twenty Twenty-One
  • Functions such as the_posts_pagination(), which go through the _navigation_markup() function in the /wp-includes/link-template.php file.

For more information, see ticket #54054.

New hook in wp_http_validate_url to control which ports are allowed for remote requests

By default, WordPress only allows ports 80, 443, and 8080 to be used for (safe) remote requests. WordPress 5.9 adds a way to remove these hardcoded ports so it is possible to better control which ports are allowed or not.

The http_allowed_safe_ports can be used to control the list of ports considered safe in HTTPHTTP HTTP is an acronym for Hyper Text Transfer Protocol. HTTP is the underlying protocol used by the World Wide Web and this protocol defines how messages are formatted and transmitted, and what actions Web servers and browsers should take in response to various commands. API, with the following parameters:

  • $allowed_ports: Array of integers for valid ports.
  • $host: Host name of the requested URL.
  • $url: The requested URL.

Usage example:

function wporg_customize_http_allowed_safe_ports( $allowed_ports, $host, $url ) {
	$allowed_ports = array( 80, 81, 443, 444, 8080, 8081 );
	return $allowed_ports;
}
apply_filters( 'http_allowed_safe_ports', 'wporg_customize_http_allowed_safe_ports', 10, 3 );

For more information, see ticket #54331.

New wp_mail_succeeded hook for the wp_mail() function

WordPress 5.9 adds a new wp_mail_succeeded action in wp_mail() after the mail is sent. Please note that the hook’s firing does not necessarily mean the recipient received the mail, only that the mail was processed without any errors.

Usage example:

/*
 * Logs each successful mail operation related to a specific user. 
 */
function wporg_wp_mail_succeeded( $mail_data ) {
	$successful_mail_logs = get_site_option( 'successful_mail_logs', array() );
	if ( 'user@example.org' === $mail_data['to'] ) {
		$successful_mail_logs[] = current_time( 'mysql' );
		update_site_option( 'successful_mail_logs', $successful_mail_logs );
	}
}
add_action( 'wp_mail_succeeded', 'wporg_wp_mail_succeeded', 10, 1 );

For more information, see Trac ticket #53826.

Use global post as the default for wp_get_post_parent_id()

Starting with WordPress 5.9, the $post parameter of wp_get_post_parent_id() is now optional, defaulting to the current global post object when called within the loopLoop The Loop is PHP code used by WordPress to display posts. Using The Loop, WordPress processes each post to be displayed on the current page, and formats it according to how it matches specified criteria within The Loop tags. Any HTML or PHP code in the Loop will be processed on each post. https://codex.wordpress.org/The_Loop..

For more information, see Trac ticket #48358.

Allow wp_register_script() to be called after wp_enqueue_script()

When a plugin registers styles/scripts on wp_enqueue_scripts (as plugin authors are encouraged to do), and conditionally enqueues their script/style on the_content 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., things “just work”. In 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. themes, the_content is run prior to the headerHeader The header of your site is typically the first thing people will experience. The masthead or header art located across the top of your page is part of the look and feel of your website. It can influence a visitor’s opinion about your content and you/ your organization’s brand. It may also look different on different screen sizes. being processed, which results in the above scenario failing.

With WordPress 5.9, the following example will work:

wp_enqueue_script( 'example' );
wp_register_script( 'example' ); 

Before 5.9, the enqueue silently failed (no “doing it wrong” message) and the following register has no impact.

Now, scripts can therefore be enqueued and dequeued (by “handle”) before they are registered.

For more information, see Trac ticket #54529.

get_term() accepts a term ID, instance of WP_Term, or an object (i.e. stdClass as a result of a db query). Starting with WordPress 5.9, functions that use get_term() also now allow for the same data types. This adds consistency, and this change is also removing extra processing code in consuming functions, so it provides better performance.

The following functions were changed accordingly:

  • get_category_feed_link()
  • get_term_feed_link()
  • get_tag_feed_link()
  • get_edit_tag_link()
  • get_edit_term_link()
  • edit_term_link()

For each of consumer of these functions, it is now possible to pass the object instead of the term ID.

For more information, see Trac ticket #50225.


Thanks @sabernhardt for proofreading.

#5-9, #dev-notes