Internationalization improvements in 6.6

Various internationalization (i18n) improvements are in WordPress 6.6, and this developers note focuses on these.

Enhanced support for only using PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 5.6.20 or higher translationtranslation The process (or result) of changing text, words, and display formatting to support another language. Also see localization, internationalization. files

WordPress 6.5 shipped with a completely new localization system with improved performance, which uses .l10n.php files in addition to .po and .mo files. This system was slightly enhanced in 6.6 to better support scenarios where only these PHP translation files exist, but not the others. This specifically applies to wp_get_installed_translations(), which is used to check which translations are installed, and the Language_Pack_Upgrader for updating translations.

See #60554 for more details.

New lang_dir_for_domain 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.

A new lang_dir_for_domain filter has been added to WP_Textdomain_Registry, allowing plugins to override the determined languages folder when using just-in-time translation loading. This is mostly useful for multilingual plugins.

See #61206 for more details.

Additional context for the load_translation_file filter

The load_translation_file filter was introduced in WordPress 6.5 to support changing the file path when loading translation files, regardless if it’s a PHP or an MO translation file. In 6.6, the localeLocale A locale is a combination of language and regional dialect. Usually locales correspond to countries, as is the case with Portuguese (Portugal) and Portuguese (Brazil). Other examples of locales include Canadian English and U.S. English. is passed as an additional argument to this filter, bringing it more in line with similar 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. filters.

See #61108 for more details.

Props to @audrasjb and @juanmaguitar for review.

#6-6, #dev-note, #dev-notes, #dev-notes-6-6, #i18n

Section Styles

In WordPress 6.6, Section Styles simplify the process of styling individual sections of a webpage by offering users a one-click application of curated styles, eliminating the need for repetitive manual configuration.

Table of Contents

  1. What’s Changed?
  2. Usage
    1. Registration of Block Style Variations
    2. Defining Block Style Variations
      1. Theme.json Partial Files
      2. Programmatically
      3. Via Theme Style Variations (Not Recommended)
  3. Backwards Compatibility
  4. Limitations
  5. What’s Next?
  6. Useful Links

What’s Changed?

Section-based styling has been enabled by extending the existing Block Styles feature (aka 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. style variations) to support styling inner elements and blocks. These enhanced block style variations can even be applied in a nested fashion due to uniform CSS specificity (0-1-0) for Global Styles introduced in WP 6.6.

In addition block style variations can now be:

  • registered across multiple block types at the same time
  • defined via multiple methods; primarily through 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. partials, or by passing a theme.json shaped object in the style’s data given to existing block style registration functions
  • customized via Global Styles (see also current limitations)

Usage

Registration of Block Style Variations

The block style variations that can be defined and manipulated through Global Styles are limited to those that have been registered with the WP_Block_Styles_Registry or via a block type’s styles property, such as Outline for the Button block. If a block style variation has not been registered, any theme.json or global styles data for it will be stripped out.

Any unregistered block style variation defined within a theme.json partial with be automatically registered.

Outlined below are three approaches to registering extended block style variations. The approaches leveraging theme.json definitions will automatically register the block style variation with the WP_Block_Styles_Registry.

Defining Block Style Variations

Outlined below are recommended approaches to registering extended block style variations.

Theme.json Partial Files

With the extension of block style variations to support inner element and block type styles, they essentially are their own theme.json file much like theme style variations. As such, block style variations also reside under a theme’s /styles directory. They are differentiated from theme style variations however by the introduction of a new top-level property called blockTypes. The blockTypes property is an array of block types the block style variation can be applied to.

A new slug property was also added to provide consistency between the different sources that may define block style variations and to decouple the slug from the translatable title property.

{
	"$schema": "https://schemas.wp.org/trunk/theme.json",
	"version": 3,
	"title": "Variation A",
	"slug": "variation-a",
	"blockTypes": [ "core/group", "core/columns", "core/media-text" ],
	"styles": {
		"color": {
			"background": "#eed8d3",
			"text": "#201819"
		},
		"elements": {
			"heading": {
				"color": {
					"text": "#201819"
				}
			}
		},
		"blocks": {
			"core/group": {
				"color": {
					"background": "#825f58",
					"text": "#eed8d3"
				},
				"elements": {
					"heading": {
						"color": {
							"text": "#eed8d3"
						}
					}
				}
			}
		}
	}
}

Programmatically

Within a theme’s functions.php 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, a call can be made to register_block_style, passing it an array of block types the variation can be used with as well as a theme.json shaped style object defining the variation’s styles. The style object provided here will be absorbed into the theme’s theme.json data.

register_block_style(
	array( 'core/group', 'core/columns' ),
	array(
		'name'       => 'green',
		'label'      => __( 'Green' ),
		'style_data' => array(
			'color'    => array(
				'background' => '#4f6f52',
				'text'       => '#d2e3c8',
			),
			'blocks'   => array(
				'core/group' => array(
					'color' => array(
						'background' => '#739072',
						'text'       => '#e3eedd',
					),
				),
			),
			'elements' => array(
				'link'   => array(
					'color'  => array(
						'text' => '#ead196',
					),
					':hover' => array(
						'color' => array(
							'text' => '#ebd9b4',
						),
					),
				),
			),
		),
	)
)

This approach has been enabled as a temporary means to facilitate ergonomic definitions of shared block style variations through theme style variations. It is being flagged here for transparency however it will likely be deprecated soon as the Global Styles architecture is updated to address growing complexity and simplify its mental model.

More details on what’s ahead for Global Styles can be found in this issue.

Shared block style variations can be defined via styles.variations. Style data defined under styles.variations will be copied to, and merged with, variation data stored at the block type level for all block types that have a matching variation registered for it.

Additionally, a new translatable title property has been added here to mirror the capabilities of the theme.json partial files outlined above.

The key for the variation correlates to the slug property for theme.json partials. In the example below, this would be variation-a.

{
	"$schema": "https://schemas.wp.org/trunk/theme.json",
	"version": 3,
	"title": "Theme Style Variation",
	"styles": {
		"variations": {
			"variation-a": {
				"color": {
					"background": "#eed8d3",
					"text": "#201819"
				},
				"elements": {
					"heading": {
						"color": {
							"text": "#201819"
						}
					},
				},
				"blocks": {
					"core/group": {
						"color": {
							"background": "#825f58",
							"text": "#eed8d3"
						},
						"elements": {
							"heading": {
								"color": {
									"text": "#eed8d3"
								}
							}
						}
					}
				}
			},
		}
	}
}

Backwards Compatibility

As the Section Styles feature was implemented via extensions to block style variations rather than as a replacement, existing block style variations will continue to work as before.

Limitations

The following limitations for block style variations in WordPress 6.6 should be noted:

  1. Only root styles, i.e. those that apply directly to the block type the block style variation belongs to, can be configured via Global Styles.
  2. Block style variations cannot redefine or customize inner block style variations.
  3. Block style variations do not support their own custom settings values (yet).
  4. Custom block style variations cannot be applied and previewed within the Style Book.

What’s Next?

The Global Styles UIUI User interface for block style variations will be updated to facilitate the customization of all available styles for inner elements and block types. This includes potentially enhancing the Style Book to support block style variations.

Another future enhancementenhancement Enhancements are simple improvements to WordPress, such as the addition of a hook, a new feature, or an improvement to an existing feature. is the possible support for settings per block style variations.

Props to @bph, @oandregal and @juanmaguitar for review

#6-6, #core-editor, #dev-note, #dev-notes, #dev-notes-6-6, #gutenberg

WordPress 6.6 CSS Specificity

One of the goals of WordPress 6.6 is to simplify the process for theme authors to override coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. styles while also maintaining support for Global Styles.

Historically, high CSSCSS Cascading Style Sheets. specificity in core styles has made customization challenging and unpredictable, often requiring complex CSS rules to achieve desired outcomes. Development of the new section styles feature also highlighted a need for uniform CSS specificity to support nesting such styles, facilitating the creation of sophisticated, layered designs.

Uniform 0-1-0 Specificity

WordPress 6.6 introduces several changes aimed at broadly reducing CSS specificity and making it more uniform. These changes generally fall into two categories:

  1. Core 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. Styles
  2. 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. / Global Styles:

Where adjustments to CSS specificity were required, they were achieved by wrapping the existing selector within :root :where(...).

Core Block Styles

The choice of 0-1-0 specificity greatly reduced the changes required to existing core block styles as blocks targeting their default .wp-block- class already have the desired specificity.

Any blocks with Global Styles support using higher specificity selectors had those selectors wrapped in :root :where(...). This also applied to Block Styles (aka block style variations) and their default styles e.g., .wp-block-image.is-style-rounded img was updated to :root :where(.wp-block-image.is-style-rounded img).

Theme.json / Global Styles:

All block styles, including block style variation styles, output by theme.json and Global Styles are now limited to 0-1-0 specificity. Layout styles, e.g., constrained, flex, flow` etc., have also been limited however depending on the specific layout type and definition the final specificity varies slightly from 0-1-0 so they apply correctly.

Usage

The alignment of 0-1-0 specificity for Global Styles to default block selectors, e.g. .wp-block-, greatly reduces the need for updates. It’s recommended for theme and block authors to double-check their designs if they rely on custom CSS using more complex selectors.

Custom blocks

Authors of custom blocks that opt into global styles and apply default styling via a selector with greater than 0-1-0 specificity, should update those selectors wrapping them in :root :where().

An example could be a custom list block that opts into padding block support but defines default padding via:

ul.wp-block-custom-list {
    padding: 0;
}

Without adjusting the specificity of this rule, any customizations of the block type’s padding in Global Styles would be overridden. Wrapping the selector in :root :where() here would allow the style load order to determine which rule takes precedence.

// Block's stylesheet
:root :where(ul.wp-block-custom-list) { // This is a contrived example and could simply be `.wp-block-custom-list`
    padding: 0;
}

// Global Styles - Loaded after the block styles
:root :where(.wp-block-custom-list) {
    padding: 1em;
}

Block Styles (aka Block Style Variations)

Theme authors customizing Block Styles for a core block will need to limit their style’s specificity, so the block style continues to be configurable via Global Styles.

For example, take a theme that tweaks the border radius for the Image block’s rounded block style:

.wp-block-image.is-style-rounded img {
    border-radius: 2em;
}

Without adjustment, this style would override any customizations made to the Rounded block style within Global Styles.

In this case, the theme can tweak its rounded image style to the following:

//. Theme style
:root :where(.wp-block-image.is-style-rounded img) {
    border-radius: 2em;
}

// Global Styles - Loaded after the block styles
:root :where(.wp-block-image.is-style-rounded img) {
    border-radius: 4px;
}

Zero-Specificity, CSS Layers, and the future

Reducing all core styles to zero specificity was explored before settling on 0-1-0 specificity. Zero specificity unfortunately wasn’t robust in the face of common reset stylesheets and required more widespread changes.

CSS Layers were also evaluated but fell short due to not being able to enforce all styles belonged to a layer. This will change in the future at which point a combination of CSS Layers and zero-specificity can be revisited to further the benefits gained in this initial reduction of CSS specificity.

More history and context can be found in this detailed discussion.

Useful Links

Props to @bph and @juanmaguitar for review

#6-6, #core-editor, #dev-note, #dev-notes, #dev-notes-6-6, #gutenberg

Data Liberation and WordPress Migrations

One thing I heard a lot about when talking to the community about Data Liberation was the challenge of WordPress-to-WordPress migrations. Exciting news for anyone who has ever struggled with that: those migrations are now going to be an important part of the Data Liberation project.

As Matt mentioned at his WCEU Keynote, “We need to make WordPress to WordPress easier.” That’s what we’ll aim to do.

Making WordPress sites easier to move could free you from being locked into a specific host, let you set up a local staging site to test changes, or even let you take a copy of your whole site as an archive.

Migrations ≠ Importing

This might seem obvious, but it’s important to point out that the WordPress Importer 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 is useful for importing content from an XML file and can definitely be used to migrate content from one site (or host) to another.

But, if the goal is to provide a 1:1 migrationMigration Moving the code, database and media files for a website site from one server to another. Most typically done when changing hosting companies. (or as close as possible), the WordPress Importer is not the tool for the job. No plugins or themes, no settings of wp-config.php, and limited support for media migration mean that we need something more.

Plenty of third-party plugins are filling this gap and meeting user needs, but we should also improve the options within WordPress itself.

Migration challenges

In discussions with hosts and agencies, several recurring challenges emerge regarding migration:

  • Getting adminadmin (and super admin) access to the source site – incorrect username and password, finding hidden login pages, insufficient user privileges, etc.
  • Incompatibilities in PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 5.6.20 or higher version or WP version between source and destination sites.
  • Incompatibilities in supported plugins between source and destination.
  • Incompatibilities in database encoding.
  • Poor server performance/resources of source site (causing backups/migrations to fail or timeout).

Migrations and WordPress Playground

Something I’m particularly excited about is the potential of the WordPress Playground. In fact, the primary proposal for improving WordPress to WordPress migrations, Site Transfer Protocol, leans on the Playground heavily. You can check the details of that proposal in this Trac ticket.

But what about third party platforms to WordPress?

Don’t worry – a focus on WordPress to WordPress doesn’t mean we’re forgetting the need for migration pathways to WP from third-party platforms. There’s more information to come regarding that – but for now you can check out this really interesting proof of concept of a browser extension to copy content from a site and paste it into the editor as Blocks.

Get Involved!

There will be opportunities soon to get your hands dirty in helping build the tools of Data Liberation – but for now, the best way to get involved is to join the Discussion on how best to solve the challenges of migration. I’m really interested in hearing about your experiences with migrating WordPress sites – the challenges, and interesting and clever ways you’ve worked around them!

You can share those experiences in the comments here – or join the  #data-liberation channel in Make Slack to share any feedback, ideas, or comments there!

You can also check out the proposal for Site Transfer Protocol (to standardise WP to WP migrations) and join the discussion there.

Summary, Dev Chat, June 19, 2024

Start of the meeting in 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/., facilitated by @mikachan. 🔗 Agenda post.

Announcements

  • WordPress 6.6 Beta 3 was released yesterday! Thank you to all the contributors for a successful release. Please continue to test and report any issues you find.
  • 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/ 18.6 is scheduled for release today. This release will not be included in WordPress 6.6.
  • Thank you so much to everyone who joined and contributed to the CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. tables on Contributor DayContributor Day Contributor Days are standalone days, frequently held before or after WordCamps but they can also happen at any time. They are events where people get together to work on various areas of https://make.wordpress.org/ There are many teams that people can participate in, each with a different focus. https://2017.us.wordcamp.org/contributor-day/ https://make.wordpress.org/support/handbook/getting-started/getting-started-at-a-contributor-day/. at WCEU!

Forthcoming Releases

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.: 6.6

We are currently in the WordPress 6.6 release cycle. See the Roadmap Post for details about what is planned for this release.

Discussion

@jeffpaul raised this just-before-chat note from Josepha on the About page and Microsites that’s worth highlighting and driving folks there for input.

Hello in here, wonderful release squad! I understand that my request about the About Page vs Microsites has gotten confusing, so I’m here to answer whatever questions we have.

In a post-release retrospective a while back, I noticed that we were working on a lot of duplicate content in various places every release. I always want to make sure that we are making the most of the time we put in, so I had asked if we could write/create the content for the microsite first, and then copy/paste highlights from it to the About page in the CMS (+ link to the microsite), and the release post.

@marybaum, @ryelle, and @annezazu are working to update the Google doc to reflect the latest priorities from the microsite for final review ahead of the upcoming string freeze.

@meher raised questions in this thread about whether a 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. 4 is needed due to 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 that didn’t make it into Beta 3?

@joemcgill said that there is no requirement to do an extra Beta release to test commits that happen between Beta 3 and RCrelease 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.

@hellofromtonya mentioned that there have also been times when an unscheduled Beta release has been done when there is a fix that needs more exposure and testing before RC 1.

After the meeting, @jorbin suggested that we codify the philosophy so we can make it easier to make these decisions in the future, and shared the following thoughts:

  1. There needs to be a large enough change (either quantity or quality) for the investment to make sense.
  2. It’s a not insignificant amount of work for each beta release. Between an announcement post, package creation, package testing and commits, it’s an investment.
  3. The investment should pay for itself in increased confidence. This confidence comes in the way of time that people can test and bug reports or bug elimination confirmations. 
  4. If possible, others investments such as a make post or a GB release may make the most sense since those can allow for increased confidence with a lower amount of required work.

Open Floor

There was no time for open floor today.

Note: Anyone reading this summary outside of the meeting, please drop a comment in the post summary, if you can/want to help with something.

Props to @mikachan for proofreading.

#6-6, #core, #dev-chat, #summary

Roster of design tools per block (WordPress 6.6 edition)

Below you find a table that lists all coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. blocks available in the inserter marks in the grid the feature they support in 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. It’s a basic lookup table that helps developers to find the information quickly.

While this post is released as part of 6.6, the content summarizes changes between 6.1 and 6.6. This is an update of the post published for the 6.1 release and provides a cumulative list of design supports added with the last five WordPress releases.

The features covered are:

  • Align
  • Typography,
  • Color,
  • Dimension,
  • Border,
  • Layout,
  • Gradient,
  • Duotone,
  • Shadow,
  • Background image*
  • Pattern overrides / Block Bindings (PO/BB)

*Note: In WordPress 6.6, the background image tools are only available for Group, Pull quote, Site Logo blocks and as side-wide feature. For Quote, Verse and Post content blocks, it’s only 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/ 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 18.6 and slated for WordPress 6.7.

Updated on July 3 with the list tracking issues to add various design tools to core blocks, so one can follow along the progress.

Work in progress

The issue Tracking: Addressing Design Tooling Consistency lists tracking issues for individual block supports.

Props to @annezazu and @juanmaguitar for review.

#6-6, #dev-notes, #dev-notes-6-6, #editor

Site-wide background images in WordPress 6.6

In WordPress 6.6 you can define site-wide background images in 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. and the Site Editor.

A “site-wide” background image is one whose value is set on the body element using the background-image CSSCSS Cascading Style Sheets. property, and, therefore, appears on every page of a site.

An example might be a photo that stretches with the window size, or a repeating pattern background.

To customize how background images appear, WordPress 6.6 supports the following background style properties:

  • background position
  • background size
  • background repeat

Usage

In theme.json

In theme.json, site-wide background images and their properties are defined under "styles.background".

For example, as a single image URI in styles.background.backgroundImage.url:

{
	"styles": {
		"background": {
			"backgroundImage": {
				"url": "<a href="http://path.to/some/image.png">http://path.to/some/image.png</a>"
			},
			"backgroundSize": "cover"
		}
	}
}

For the above, WordPress will automatically wrap the image in the CSS url() function.

styles.background.backgroundImage also accepts string values, which can be any valid CSS value for background-image :

{
	"styles": {
		"background": {
			"backgroundImage": "url(<a href="http://path.to/some/image.png">http://path.to/some/image.png</a>)",
			"backgroundPosition": "center"
		}
	}
}

The above examples use absolute paths to image files. Such files would need to be hosted and maintained.

Most likely, theme developers will want to define background images using paths to a theme’s own assets. This ensures that the theme is self-contained and portable.

Relative paths to theme assets are defined using the file:./ prefix:

{
	"styles": {
		"background": {
			"backgroundImage": {
				"url": "file:./assets/my-theme-background.jpg"
			},
			"backgroundSize": "cover"
		}
	}
}

Paths are resolved on the backend using get_theme_file_uri.

Paths defined this way must be relative to the theme root, regardless of where the theme.json sits in your theme’s directory. This follows an existing pattern for web fonts.

Despite the dot in file:./, the special symbols dot (.) and double dot (..) for directory navigation are not supported in theme.json relative paths. This means, for example, that theme style variation files, which reside under the style/ directory, would use the same path as the theme’s main theme.json.

An issue exists to make the syntax more consistent.

In the Site Editor

Background images can be also be uploaded, and their properties tweaked through the Site Editor’s styles panel.

In WordPress 6.6, background image controls are located under Styles > Layout.

The styles panel navigation is undergoing review however, so in upcoming versions the location may change.

As well as setting new background images, it’s possible to “remove” a theme’s default background image in the Site Editor.

Relative paths to any images in theme.json are resolved on the backend, and are sent in the _links array of Global Styles REST responses. The Editor uses the resolved values to generate theme CSS in the client.

Limitations

In WordPress 6.6, the ability to define background images in theme.json exists only for top-level styles. Top-level styles apply to the body element. An open PR aims to also enable the feature at 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. level in the next WordPress release.

Work is also underway to:

  • add support for fixed images, using the background-attachment CSS property.
  • avoid conflicts between gradient backgrounds, whose values are currently set to the background property, and background-image. The proposal is that gradient backgrounds will also be set to background-image, and, where both an image and a gradient are defined, their values are merged .

Backwards compatibility

WordPress already has support for custom site-wide background images in the Customizer. The theme.json variant will not affect themes that have enabled this feature.

Background images added in 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. take precedence over those set in theme.json or in the Site Editor.

An ongoing discussion seeks to harmonize the two features.

What’s next

Progress on upcoming work is tracked on Background Image block support follow-up tasks.

Props to @andrewserong and @juanmaguitar for review

#6-6, #core-editor, #dev-note, #dev-notes, #dev-notes-6-6, #gutenberg

What’s new in Gutenberg 18.6

“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 posted following every Gutenberg release on a biweekly basis, showcasing new features included in each release. As a reminder, here’s an overview of different ways to keep up with Gutenberg and the Editor.


Gutenberg 18.6 has been released and is available for download!

51 contributors have shipped 157 pull requests in this release, and a big welcome to four new contributors. With WordPress 6.6 rapidly approaching, many contributors are focusing on 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, with this release including a total of 62 fixes. There are still some great features being worked on, and this release introduces the new background image feature to several blocks.

Thanks to everyone involved in this release! 👏

  1. Background image support for Quote, Verse and Post Content blocks
  2. DataViews: Extensibility APIs
  3. Changelog
  4. First-time contributors
  5. Contributors

Background image support for Quote, Verse and Post Content blocks

Screenshot of the quote block with a background image
Screenshot of the verse block with a background image

Freshen up the look of the quote, verse, and post content blocks using the new background image feature.

Previously, options for background images were limited to container blocks like the Cover and Group blocks, but with the feature now supported across several blocks, it’s easier for users to attain the look they want without nesting blocks.

Follow all the work on background images in the GitHub tracking issue.

DataViews: Extensibilty APIs

Very early work on extensibility for DataViews was shipped in this release.

‘DataViews’ is the component that powers the post listing views available in the Site Editor, and in the future will become an important part of the new adminadmin (and super admin) design project.

The 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. being explored will allow the registration of actions for different ‘entities’ (post types and other types of data represented by the listings). Right now, the API is private to 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 and will undergo further development and testing before being made public for third parties.

Find out more in the GitHub pull request for the feature, and read the recent update on DataViews for more background on the work.

Changelog

Enhancements

Design Tools

  • Post content 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.: Add background image and padding support. (62499)
  • Quote blocks: Add background image and minimum height support. (62497)
  • Verse block: Add background image and minimum height support. (62498)

Block Library

  • Post Date & Comment Date: Add relative date format. (62298)
  • Replace “Add new post” link text with more meaningful Label (v2). (62277)

Block Editor

  • LinkControl: Refined the display of the link preview title and URLURL A specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org when both are same. (61819)
  • Update URL to uppercase. (62231)

Block bindings

  • Change bindings panel title, add description. (62489)

Site Editor

  • Unify DataViews 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. Title & Subtitle. (62429)
  • Template inspector: Small visual adjustments. (62537)

Document Settings

  • FlatTermSelector: Update the term suggestion limit. (62359)

Global Styles

  • Update custom CSSCSS Cascading Style Sheets. handling to be consistent with block global styles. (62357)

Post Editor

  • Try: Re-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/. StrictMode. (61943)

New APIs

Extensibility

  • DataViews: Bootstrap Actions Extensibility API. (62052)

Bug Fixes

  • CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. Data: Fix errors when the entities list doesn’t contain configuration key. (62346)
  • Data Views: Bulk toolbar covering other clickable elements. (62333)
  • Fix: Omit default parameters from pages, template parts, and patterns. (62372)
  • Fix: Show homepage link on frontpage instead of the slug. (62279)
  • Fix: Unquoted file argument in declaration check script. (62482)
  • List: Fix pasting. (62428)
  • Revert CSS removal for interface footer breadcrumbs. (62309)
  • Revert test data for WithSlug variation. (62579)
  • Scripts: Pin the wordpress/scripts version to a version supported by 6.5. (62234)
  • Site Editor Hub: Simplify. (61579)
  • Style Book: Allow activation when the canvas mode is “view”. (62212)
  • Top toolbar: Fix half a pixel artifacting of the bottom border. (62225)
  • Try: Contextual frame bg color to avoid artifacting. (62223)
  • Try: Fix mover positioning. (62226)
  • Update instances of text-wrap: Pretty to fall back to balance. (62233)
  • MediaUpload: Remove dialog markup on close. (62168)

Global Styles

  • Add default-spacing-sizes and default-font-sizes options for classic themes. (62252)
  • Add custom CSS for block style variations. (62526)
  • Color Variations: Use Grid rather than VStack. (62445)
  • Don’t apply the background and text colors to typography previews. (62578)
  • Fix UIUI User interface appearing on blocks that don’t support text alignment. (62376)
  • Fix UI order for 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. spacing sizes. (62199)
  • Fix registration of theme style variation defined block styles. (62495)
  • Only use single property variations as color/type presets. (62469)
  • Section Styles: Register block style variations on init. (62461)
  • Section styles: Consolidate variation name. (62550)
  • Section styles: Support 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. for variations declared in theme.json or theme style variations. (62552)
  • Sort spacing sizes when all slugs begin numerically. (62567)

Site Editor

  • Change Site Editor to Edit site. (62501)
  • Fix “insert before/after” not showing for blocks in site editor. (62530)
  • Site Export: Ensure that the export endpoint uses Gutenberg theme classes. (61561)
  • Update old document URLs to new ones. (62206)
  • Update 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. title + icon + site title alignment. (62191)

Block Editor

  • Inserter: Allow focus to move to the toggle when opening the inserter. (62513)
  • Inserter: Return the same items when the state and parameters don’t change. (62263)
  • Remove ‘rootClientId’ argument for block lock selectors. (62547)
  • Update fetchLinkSuggestions to sort results by relevancy. (62397)

Block Library

  • Fixed Media Text Block Issue : When crop image to fill is enabled, the image in nested media & text blocks does not show. (62182)
  • Media & Text block: Fix nested Media & Text block media position issue with increased CSS specificity. (62184)
  • Query: Adjust the position of sticky search field in Patterns modal. (62370)

Post Editor

  • Editor: Avoid remounts of DocumentBar. (62214)
  • Editor: Make 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. more prominent. (62323)
  • Editor: Refine availability of rename post action. (62248)
  • Fix move CONTENT_ONLY_BLOCKS into component body to ensure the editor.postContentBlockTypes 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. gets called whenever the values are used. (62292)

Components

  • Ensure that openref is defined before accessing to .current. (62508)
  • Fix: Update styles for checkbox and radio controls. (61696)
  • Tabs: Prevent accidental overflow in indicator. (61979)

List View

  • Fix home and end key behaviour in very long lists. (62312)
  • Respect default shortcuts in modals. (62479)
  • Show context menu for content-only blocks in posts. (62354)

Block bindings

  • Fix applying bindings or pattern overrides to button blocks with empty text. (62220)
  • Fix site editor breaking when user selects bound and non-bound blocks at the same time. (62268)
  • Revert changes to bindings replacement logic to not use regex. (62355)

Synced Patterns

  • Block Bindings / Pattern Overrides: Prevent normal attribute updates when a __default binding exists. (62471)
  • Fix showing double icons for connected blocks in pattern editor. (62317)

Data Views

  • DataViews: Fix unnecessary horizontal scrollbar in list layout. (62448)
  • Page creation and duplication: Decode HTMLHTML HyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. entities in success notices. (62313)

Patterns

  • Fix increasingly big canvas in the post editor when editing patterns. (62360)
  • i18n: Patterns: Disambiguate singular & plural uses of ‘Synced’ & ‘Unsynced’. (62375)

Data Layer

  • Data: Add error handle to the ‘registry.batch’ method. (62322)

Block Variations

  • Compare objects based on given properties. (62272)

Block Styles

  • Remove core block style variations filters and action. (62090)

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)

  • Add lint rule for inaccessible disabled Button. (62080)
  • Placeholders: Fix contrast. (62416)

Global Styles

  • Display tooltips for pagination buttons on styles revision. (62395)

Site Editor

  • Make edit site pagination buttons accessibly disabled. (62267)

Performance

  • reporter: Print the stdout/stderr from the worker. (62316)

Block bindings

  • Only run block bindings Gutenberg logic for sites using WordPress versions below 6.5. (62363)

Interactivity API

  • Use data-wp-on-async directives in core blocks when handler does not need synchronous access to event. (62160)

Experiments

Posts/Tags/Categories Screen

  • Bootstrap the dashboard layout. (62409)
  • Posts Dashboard: Add a new experimental empty page. (62406)

Documentation

  • Add @global PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 5.6.20 or higher documentation. (60539)
  • Add documentation for PostSticky and PostStickyCheck component. (62100)
  • Add documentation for WordCount component. (62217)
  • Added documentation for PostTrash & PostTrashCheck TimeToRead TextEditorGlobalKeyboardShortcuts PostPublishButtonLabel Component. (62116)
  • Better changelogs for the JSX transform upgrade. (62265)
  • Corrected @SInCE Order in Php documentation. (61992)
  • Docs: Explicitly mention new behavior coming in WP 6.6 for block variations. (62399)
  • EntitiesSavedStates editor component. (62377)
  • Fix @since 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.) in docblockdocblock (phpdoc, xref, inline docs) in WP_Theme_JSON_Data_Gutenberg. (62425)
  • Fix: Invalidinvalid A resolution on the bug tracker (and generally common in software development, sometimes also notabug) that indicates the ticket is not a bug, is a support request, or is generally invalid. link on explanations documentation. (62487)
  • Fixing minor syntax in DataView example code. (62560)
  • Interactivity API template create block: Removed warning for generated README from template. (62324)
  • PostPublishButton, PostPublishButtonLabel editor components. (62379)
  • PostPublishPanel editor component. (62380)
  • PostSwitchToDraftButton editor component. (62381)
  • PostSyncStatus editor component. (62382)
  • PostTaxonomies, PostTaxonomiesCheck, PostTaxonomiesFlatTermSelector, PostTaxonomiesPanel related editor components. (62384)
  • Several typo correction in documentations. (62433)
  • TableOfContents editor component. (62385)
  • ThemeSupportCheck editor component. (62387)
  • Update React API reference links in wordpress/element reference-guides. (62475)
  • Update: Slotfill documentation samples (links, code, and rephrase). (62271)
  • UseEntitiesSavedStatesIsDirty editor component. (62388)
  • block.json schema: Add supports.splitting field. (62209)

Code Quality

  • Add support for local keyframes through a PostCSS plugin. (62476)
  • Block style variation: Rename hook. (62464)
  • Chore: Simplify a padding style on global styles. (62291)
  • Convert autop package to TS. (62583)
  • Convert blob package to TS. (62569)
  • Convert escape-html package to TS. (62586)
  • Convert token-list package to TypeScript. (62584)
  • Convert warning package to TS. (62557)
  • Editor: Cleanup styles and classnames. (62237)
  • Editor: Deprecate PostSwitchToDraftButton. (62402)
  • Editor: Introduce the Editor component and use it in the site editor. (62274)
  • Fix unintended overwrite of eslint no-restricted-syntax. (62301)
  • Fix: Add network-active to valid options in PluginStatus Type definition. (62450)
  • Fix: Flakey deferred store test. (62571)
  • Fix: Remove unused code from dataviews styles. (62275)
  • Fix: Remove unused typography panel styles. (62295)
  • Fixed : Disambiguate “Cover” translatable string in the context of background-panel.js. (62440)
  • Move the template part menu items to the editor package. (62366)
  • Shortcut Help modal: Remove CSS hack for Internet Explorer 11. (62564)
  • Use stable reference for getEntityActions action. (62536)

Global Styles

  • Global styles code quality refactoring. (62299)
  • Migrate theme.json based on origin. (62305)
  • Send theme object to setUserConfig. (61805)

Synced Patterns

  • Extract the pattern overrides toolbar indicator from the block-editor package. (62514)
  • Remove unused syncDerivedUpdates action. (62229)

Post Editor

  • Editor: Combine selector in provider component. (62407)
  • Editor: Use the Editor component in the post editor. (62339)

Site Editor

  • Remove editor specific classes from shell wrapper. (62389)
  • Remove unused code. (62286)

Icons

  • Fix React warning error for offline icon. (62353)

Data Views

  • Chore: Simplify a padding style on dataviews. (62276)

Block Editor

  • Use border instead of hr for filtered block list separator. (62249)

Block bindings

  • Use preview instead of publishing post in block bindings tests. (62235)

Block API

  • Parser: Update validateBlock to use fixedBlock. (62178)

Tools

Testing

  • Fix flaky Site Editor command center end-to-end test. (62454)
  • Perf Tests: Use backward-compatible locators. (62362)
  • Test using Node.js 22.x. (62341)
  • Try: Fix flaky DataViews end-to-end test. (62413)
  • Update Node version for flaky test reporter. (62401)
  • end-to-end Utils: Add retry mechanism 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/. discovery. (62331)

Build Tooling

  • Build JSJS JavaScript, a web scripting language typically executed in the browser. Often used for advanced user interfaces and behaviors. module only in development mode. (62398)
  • Speed up check-build-type-declaration-files. (62538)

wp-env

  • Add JSON Schema for .wp-env.json files. (36276)
  • Add WP_ENV_TESTS_MYSQL_PORT / .wp-env.json .env.tests.mysqlPort option etc. (61057)

Various

  • Update all ConfirmDialogs in the codebase to be size=medium. (62532)

REST API

  • Themes REST API endpoint: Add stylesheet_uri and template_uri fields to the response (WP 6.6). (62211)

First-time contributors

The following PRs were merged by first time contributors:

Contributors

The following contributors merged PRs in this release:

@aaronrobertshaw@aaronware@afercia@ajlende@akasunil@amitraj2203@andrewserong@BrianHenryIE@carolinan@carstingaxion@cbravobernal@colorful-tones@DaniGuardiola@desrosj@ellatrix@fabiankaegy@geriux@gigitux@gziolo@jameskoster@jasmussen@jeryj@joemcgill@jorgefilipecosta@jsnajdr@juanmaguitar@kevin940726@Mamaduka@mcsf@mirka@narenin@noisysocks@ntsekouras@oandregal@ockham@ramonjd@richtabor@SantosGuillamot@scruffian@shail-mehta@sirreal@stokesman@t-hamano@talldan@tellthemachines@tjcafferkey@up1512001@vipul0425@westonruter@WunderBart@youknowriad

Props to @jameskoster for the visual assets, @priethor for handling 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). at short notice, @andrewserong, @isabel_brison, @annezazu, and @matveb for help with drafting and proof reading this post.

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

Theme.json version 3

The 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. version is incremented whenever a breaking change would need to be made to the 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.. This allows consumers to opt-in to the breaking change by updating the version. Older theme.json versions will always be supported in the latest versions of WordPress.

Updating to version 3 is recommended when your minimum supported WordPress version reaches 6.6. See theme.json version 3 frequently asked questions for more information on when to update. Then check out the theme.json reference for migrationMigration Moving the code, database and media files for a website site from one server to another. Most typically done when changing hosting companies. instructions when you are ready to update.

Breaking changes in version 3

Starting with theme.json version 3 the default behavior for using the same slugs as the default fontSizes and spacingSizes presets has been changed to match how other theme.json presets work: from always overriding the default presets to requiring defaultFontSizes or defaultSpacingSizes to be false in order to override the default presets.

Default font sizes

settings.typography.defaultFontSizes is a new option in theme.json v3. It controls whether the coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. provided default settings.typography.fontSizes presets are shown and used.

The default fontSizes presets’ slugs are: small, medium, large, and x-large.

  • When defaultFontSizes is true it will show the default font sizes in the editor and prevent the theme from creating presets using the default slugs.
  • When defaultFontSizes is false it will hide the default font sizes in the editor and allow the theme to use the default slugs.

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. themes defaultFontSizes is true by default. This is consistent with how other default* options work such as settings.color.defaultPalette.

For classic themes there is a new theme support default-font-sizes which is also true by default. However, unlike block themes, it is set to false when editor-font-sizes theme support is defined.

In theme.json v2, the default font sizes were only shown when theme sizes were not defined. A theme providing font sizes with the same slugs as the defaults would always override the defaults.

To keep behavior similar to v2 with a v3 theme.json:

  • If you do not have any fontSizes defined, defaultFontSizes can be left out or set to true.
  • If you have some fontSizes defined, set defaultFontSizes to false.
--- theme.json v2
+++ theme.json v3
@@ -1,24 +1,25 @@
 {
-	"version": 2,
+	"version": 3,
 	"settings": {
 		"typography": {
+			"defaultFontSizes": false,
 			"fontSizes": [
 				{
 					"name": "Small",
 					"slug": "small",
 					"size": "10px"
 				},
 				{
 					"name": "Medium",
 					"slug": "medium",
 					"size": "14px"
 				},
 				{
 					"name": "Large",
 					"slug": "large",
 					"size": "20px"
 				}
 			]
 		}
 	}
 }

Default spacing sizes

settings.spacing.defaultSpacingSizes is a new option in theme.json v3. It controls whether the core provided default settings.spacing.spacingSizes presets are shown and used.

The default spacingSizes presets’ slugs are: 20, 30, 40, 50, 60, 70, and 80.

  • When defaultSpacingSizes is true it will show the default spacing sizes in the editor and prevent the theme from creating presets using the default slugs.
  • When defaultSpacingSizes is false it will hide the default spacing sizes in the editor and allow the theme to use the default slugs.

defaultSpacingSizes is true by default. This is consistent with how other default* options work such as settings.color.defaultPalette.

For classic themes there is a new theme support default-spacing-sizes which is also true by default. However, unlike block themes, it is set to false when editor-spacing-sizes theme support is defined.

In theme.json v2, the default spacing sizes were only shown when theme sizes were not defined. A theme providing spacing sizes with the same slugs as the defaults would always override the defaults.

Furthermore, there are two settings that can be used to set theme level spacing sizes: spacingSizes and spacingScale. With theme.json v3, presets from both will be merged together and sorted numerically by slug. Presets defined in spacingSizes will override those generated by spacingScale if the slugs match.

In theme.json v2, setting both spacingSizes and spacingScale would only use the values from spacingSizes.

To keep behavior similar to v2 with a v3 theme.json:

  • If you do not have any spacingSizes presets or spacingScale config defined, defaultSpacingSizes can be left out or set to true.
  • If you disabled default spacing sizes by setting spacingScale to { "steps": 0 }, remove the spacingScale config and set defaultSpacingSizes to false.
  • If you defined only one of either spacingScale or spacingSizes for your presets, set defaultSpacingSizes to false.
  • If you defined both spacingScale and spacingSizes, remove the spacingSizes config and set defaultSpacingSizes to false.
--- theme.json v2
+++ theme.json v3
@@ -1,27 +1,25 @@
 {
-	"version": 2,
+	"version": 3,
 	"settings": {
 		"spacing": {
-			"spacingScale": {
-				"steps": 0
-			},
+			"defaultSpacingSizes": false,
 			"spacingSizes": [
 				{
 					"name": "Small",
 					"slug": "40",
 					"size": "1rem"
 				},
 				{
 					"name": "Medium",
 					"slug": "50",
 					"size": "1.5rem"
 				},
 				{
 					"name": "Large",
 					"slug": "60",
 					"size": "2rem"
 				}
 			]
 		}
 	}
 }

Props to @scruffian and @juanmaguitar for assistance with writing and reviewing this post.

#6-6, #dev-note, #dev-notes, #dev-notes-6-6

Social Links block changes in WordPress 6.6

WordPress 6.6 includes some changes affecting both the social link and social links blocks.

HTMLHTML HyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. changes when using a social links 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. inside a Navigation Block

As of WordPress 6.6, the social links block will be wrapped in a list item (li 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.)) when used in the navigation block. This change fixed an issue where the navigation block produced invalidinvalid A resolution on the bug tracker (and generally common in software development, sometimes also notabug) that indicates the ticket is not a bug, is a support request, or is generally invalid. HTML (the social links block’s ul was nested directly under the navigation block’s ul).

This may affect some themes that depend on the exact nesting of the HTML elements, for example using a selector like .wp-block-navigation__container > .wp-block-social-links.

Here are some examples of how the HTML has changed:

Example of navigation block and social links markup before WordPress 6.6

<ul class="wp-block-navigation__container wp-block-navigation">
  <ul class="wp-block-social-links is-layout-flex wp-block-social-links-is-layout-flex">
  </ul>
</ul>

Example of navigation block and social links markup after WordPress 6.6

<ul class="wp-block-navigation__container wp-block-navigation">
  <li class="wp-block-navigation-item">
    <ul class="wp-block-social-links is-layout-flex wp-block-social-links-is-layout-flex">
    </ul>
  </li>
</ul>

Class name changes to the social link block

As of WordPress 6.6, the social link block will no longer output the components-button class name on its button element within the block editor.

Themes targeting this class name for editor styles should use the existing wp-block-social-link-anchor class instead.

It’s expected that most themes will be doing this already, so for most no change will be required.

Why was this class name present?

The class name was a side-effect of using the Button ReactReact React is a JavaScript library that makes it easy to reason about, construct, and maintain stateless and stateful user interfaces. https://reactjs.org/. component from the @wordpress/components package (which can also be referenced as wp.components.Button) within the social link block’s implementation.

Why is this being changed?

  • The components from @wordpress/components are intended for use in the editor’s general interface and have a lot of opinionated CSSCSS Cascading Style Sheets., while the on-canvas part of a block is intended to be styled by a theme and should have minimal CSS.
  • Updates made to styles in the @wordpress/components can have unintended side-effects for the block’s appearance, and can also raise or lower the specificity of the styles above or below what a theme implementer might expect. The change to the block’s implementation leads to more stable and predictable css specificity.
  • There’s no guarantee the styles from @wordpress/components will continue to work in the iframed editor canvas, some CSS variable references in the styles were already not working as expected.
  • The styles that were previously added to the social link block contravene the CSS guidelines used by developers on the WordPress project.

Props to @ramonopoly and @juanmaguitar for review

#6-6, #dev-note, #dev-notes, #dev-notes-6-6