Performance Chat Agenda: 12 March 2024

Here is the agenda for this weekโ€™s performance team meeting scheduled for Mar 12, 2024 at 16:00 UTC.

  • Announcements
    • Welcome to our new members of #core-performance
    • WordPress 6.5 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). 2 is today
    • Reminder on timezone difference for the next 3 weeks, this chat will remain at 16:00 UTC
  • Priority items
    • WordPress performance TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. tickets
    • Performance Lab 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 other performance plugins)
    • Active priority projects
      • Plugin checker
      • Improve template loading
      • INP opportunities research
  • Open floor

If you have any topics youโ€™d like to add to this agenda, please add them in the comments below.


This meeting happens in the #core-performance channel. To join the meeting, youโ€™ll need an account on the Make WordPress Slack.

#agenda, #meeting, #performance, #performance-chat

Miscellaneous Editor changes in WordPress 6.5

In this post, you will find dev notesdev note Each important change in WordPress Core is documented in a developers note, (usually called dev note). Good dev notes generally include a description of the change, the decision that led to this change, and a description of how developers are supposed to work with that change. Dev notes are published on Make/Core blog during the beta phase of WordPress release cycle. Publishing dev notes is particularly important when plugin/theme authors and WordPress developers need to be aware of those changes.In general, all dev notes are compiled into a Field Guide at the beginning of the release candidate phase. for smaller changes to the editor in WordPress 6.5.


Table of contents

  1. New Block Supports
  2. Footnotes support for Custom Post Types
  3. DependencyExtractionWebpackPlugin: Drop webpack4 and node<18
  4. Enable Block Renaming support for (almost) all blocks
  5. Stabilization of the block editorโ€™s RecursionProvider API
  6. Support for newย allowedBlocksย field inย block.json
  7. Add new selectors to fetch entity revisions
  8. Newย useSettingsย hook for reading block instance settings
  9. Introduction of the PluginPostExcerpt Slot Component
  10. Changes to the underlyingย Compositeย component implementation
  11. Deprecated components
  12. Setting to disable custom content size controls

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

Background image block support additional features for size, repeat, and position

In WordPress 6.5, the background image block support receives new controls related to the size of the background image: size, repeat, and position.

For blocks that use the background image block support (currently, the Group block is the only coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. block to use this support), these optional controls can now be displayed. They are hidden by default behind the tools panel menu in the Background controls on the inspector 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..

How to add backgroundSize support to a theme

There are two ways to add support forย backgroundSizeย and the related size, as well as repeat and position control to a block theme. The simplest one is to opt into theย appearanceToolsย setting, which automatically enables a number of design tools (read more in the developer handbook).

For themes that wish to have more granular control over which UIUI User interface tools are enabled, theย backgroundSizeย support can be opted into by settingย settings.background.backgroundSizeย toย trueย inย theme.json. For example:

{
"settings": {
"background": {
"backgroundImage": true,
"backgroundSize": true

Note that as of WordPress 6.4 and WordPress 6.5, theย backgroundImage,ย backgroundSize,ย and related supports are only available at the individual block level, not in global styles or at the site root. These features will be explored in subsequent releases, with progress tracked in this GithubGitHub GitHub is a website that offers online implementation of git repositories that 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 by the repository owner. https://github.com/ issue:ย #54336.

GitHub pull request: #57005

Props to @andrewserong for writing the dev notedev note Each important change in WordPress Core is documented in a developers note, (usually called dev note). Good dev notes generally include a description of the change, the decision that led to this change, and a description of how developers are supposed to work with that change. Dev notes are published on Make/Core blog during the beta phase of WordPress release cycle. Publishing dev notes is particularly important when plugin/theme authors and WordPress developers need to be aware of those changes.In general, all dev notes are compiled into a Field Guide at the beginning of the release candidate phase..

Aspect ratio block support

A new aspect ratio block support has been added in WordPress 6.5, with the Cover block opted-in by default. For themes using theย appearanceToolsย feature inย theme.json, the control will be available in the inspector controls under Dimensions.

The feature allows users to set an aspect ratio for the Cover block, and is mutually exclusive withย min-heightย rules. If an aspect ratio is set, thenย min-heightย isย unsetย to ensure that height rules do not conflictconflict A conflict occurs when a patch changes code that was modified after the patch was created. These patches are considered stale, and will require a refresh of the changes before it can be applied, or the conflicts will need to be resolved. with the aspect ratio. The aspect ratio rules will be output at render-time for the block via an inline style applied to the blockโ€™s wrapper.

Note that themes or blocks that add width or height rules to a block will need to take care in testing compatibility withย aspect-ratioย if they are to opt-in to aspect ratio support. The aspect ratio tends to work most flexibly when width or height rules are not set.

How to add aspectRatio support to a theme

There are two ways to add support forย aspectRatioย to a block theme. The simplest is to opt into theย appearanceToolsย setting, which automatically enables a number of design tools (read more in the developer handbook).

For themes that wish to have more granular control over which UI tools are enabled, theย aspectRatioย support can be opted into by settingย settings.dimensions.aspectRatioย toย trueย inย theme.json. For example:

{
"settings": {
"dimensions": {
"aspectRatio": true

GitHub pull request: #56897

Props to @andrewserong for writing the dev note.

Add block gap support to Quote block

The Quote block hasย blockGapย support in WordPress 6.5. It also changes the default spacing between the quote and the citation in block themes that haveย blockGapย enabled, to be consistent with all other blocks that use the layout support. The default spacing will now use the layout spacing rules defined by a themeโ€™sย styles.spacing.blockGapย value inย theme.json.

For themes that useย blockGapย but wish to use a different gap between the quote and the citation, they can set aย spacing.blockGapย value for the block directly.

GitHub pull request: #56054

Props to @andrewserong for writing the dev note.

Add padding and margin support to the Pullquote block

Pullquote block now supports padding and margin. At the same time, the browser default margin applied to the blockquote element inside the block has been reset to zero to ensure that padding values are applied accurately inside the block. Depending on themes, this effect may result in visual changes and the need to adjust padding or margin.

GitHub pull request: #45731

Props to @wildworks for writing the dev note.

Footnotes support for Custom Post Types

In WordPress version 6.5, footnotes are now supported on any custom post typeCustom Post Type WordPress can hold and display many different types of content. A single item of such a content is generally called a post, although post is also a specific post type. Custom Post Types gives your site the ability to have templated posts, to simplify the concept. that fulfills certain requirements. To be eligible for footnotes, a custom post type must have capabilitiescapability Aย capabilityย is permission to perform one or more types of task. Checking if a user has a capability is performed by the current_user_can function. Each user of a WordPress site might have some permissions but not others, depending on theirย role. For example, users who have the Author role usually have permission to edit their own posts (the โ€œedit_postsโ€ capability), but not permission to edit other usersโ€™ posts (the โ€œedit_others_postsโ€ capability). like 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/, custom fields, 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., and editor support. If a post type meets these requirements, footnotes should be available by default without requiring any changes from the developer.

However, if a developer wants to remove footnotes support in a specific condition, for example, in a particular post type, they can use the block 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. like any other block. The following code sample demonstrates how we can remove footnotes support from the โ€œpostโ€ post type:


add_filter( 'allowed_block_types_all', 'footnotes_allowed_block_types', 10, 2 );

function footnotes_allowed_block_types( $allowed_blocks, $editor_context ) {
if( 'post' === $editor_context->post->post_type ) {
$allowed_blocks_array = array();
if ( is_array( $allowed_blocks )) {
$allowed_blocks_array = $allowed_blocks;
} else if( $allowed_blocks === false ) {
return false;
} else if ($allowed_blocks === true ) {
$block_types = WP_Block_Type_Registry::get_instance()->get_all_registered();
foreach( $block_types as $block_type) {
$allowed_blocks_array[] = $block_type->name;
}
}

$allowed_blocks = array_values( array_diff( $allowed_blocks_array, array(
'core/footnotes',
) ) );
}
return $allowed_blocks;
}

GitHub pull request: #57353

Props to @jorgefilipecosta for writing the dev note.

DependencyExtractionWebpackPlugin: Drop webpack4 and node<18

As webpack4 doesnโ€™t support modules that blocks require to work, and that webpack5 was released more than three years ago, the support for webpack4 is dropped in WordPress 6.5.

In addition, the support for Node.js version 17 or older is dropped, as Node.js 18 is currently the oldest maintained version.

  • @wordpress/scriptsย version 17 has dropped official support for unmaintained Node.js versions. The oldest supported Node.js version is now Node.js 18.
  • @wordpress/dependency-extraction-webpack-pluginย version 5 has dropped official support for unmaintained Node.js versions. The oldest supported Node.js version is now Node.js 18.
  • @wordpress/dependency-extraction-webpack-pluginย version 5 has dropped support for webpack versions less than 5. Users should either upgrade to webpack v5 or continue to use v4 of 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.. Version 4 will not be maintained going forward.
    If youโ€™re usingย @wordpress/dependency-extraction-webpack-pluginย viaย @wordpress/scripts, the webpack change should not affect you.

GitHub pull request: #57303

Props to @jonsurrell for writing the dev note.

Enable Block Renaming support for (almost) all blocks

Building onย the foundation introduced in WordPress 6.4,ย allย blocks (with some exceptions) can now be given custom names within the Editor.

The data for this continues to be stored under theย nameย property of theย blockโ€™sย metadataย attributeย (e.g.ย attributes.metadata.name).

All blocks (including 3rd party blocks) will be โ€œrenameableโ€ย by default, with the only exceptions being the following blocks:

  • core/block
  • core/template-part
  • core/pattern
  • core/navigation
  • core/navigation-link

To disable the ability to rename a block, set the relevant support property toย falseย inย block.json:

// block.json
{
	"supports": {
		"renaming": false // disables ability to rename block via the Editor UI
	},
}

GitHub pull request: #54426

Props to @get_dave for writing the dev note.

Stabilization of the block editorโ€™s RecursionProvider API

Context

Originally implementedย as an experimental hook namedย __experimentalUseNoRecursiveRenders ย in early 2021, thenย improved and repackagedย in 2022 as the pairย __experimentalRecursionProviderย andย __experimentalUseHasRecursion, the purpose of these APIs is to prevent certain advanced block types from accidentally triggering infinite rendering loops inside the block editor. For example, the Template block must guard against these loops:

  • If a user adds an instance of the Template block into the contents of that same template (linear recursion);
  • If Template A contains Template B, which then contains Template A (mutual recursion).

As of today, the following core block types use the RecursionProvider API:ย 

  • core/block
  • core/navigation
  • core/post-content
  • core/template-part.

Changes with WordPress 6.5

The API has been promoted to stable, thereby shedding theย __experimentalย prefix. Consumers should now use the API by importingย RecursionProviderย andย useHasRecursionย fromย @wordpress/block-editor, or via the WP global asย wp.blockEditor.RecursionProviderย andย wp.blockEditor.useHasRecursion.

For more details and a working example, see the componentโ€™sย README.md document.

BeforeAfter
wp.blockEditor.__experimentalRecursionProviderwp.blockEditorRecursionProvider
wp.blockEditor.__experimentalUseHasRecursionwp.blockEditor.useHasRecursion

Backwards compatibility

The former identifiers โ€”ย __experimentalRecursionProviderย andย __experimentalUseHasRecursionย โ€” are now deprecated. This means thatย they are still accessible, but their use will trigger a warning in the browser console.

GitHub pull request: #58120

Props to @mcsf for writing the dev note.

Support for newย allowedBlocksย field inย block.json

WordPress 6.5 adds support for the new allowedBlocks field in theย block.jsonย file. It lets block developers specify which block types can be inserted as children of the given block. Itโ€™s a companion to the existingย parentย andย ancestorย fields that have a similar function, namely specifying allowed parent block types. Example of usage in aย block.jsonย file:

{
  "name": "core/list",
  "title": "List",
  "allowedBlocks": [ "core/list-item" ]
}

One of the main advantages of theย block.jsonย field is that it can be modified by plugins. For example, you can create a block that acts as a custom list item and extend the Core List block so that your custom block can be inserted as its child:

addFilter( 'blocks.registerBlockType', 'my-list-item', ( settings, name ) => {
  if ( name === 'core/list' ) {
    const { allowedBlocks = [] } = settings;
    return { ...settings, allowedBlocks: [ ...allowedBlocks, 'my/list-item' ] };
  }
  return settings;
} );

This new API replaces theย allowedBlocksย option that can be passed to theย useInnerBlocksPropsย hook inside the blockโ€™sย editย function. This option was previously used to implement the same check, but it wasnโ€™t extensibleExtensible This is the ability to add additional functionality to the code. Plugins extend the WordPress core software.: the list of allowed blocks was hardcoded in the blockโ€™sย editย function and couldnโ€™t be modified.

Theย allowedBlocksย option on theย useInnerBlocksPropsย hook is still supported and is not deprecated, but you should use it only for specialized use cases. Like when the list of allowed blocks is dynamically calculated for each block: from its attributes, or from its surrounding environment (the parent block etc.).

GitHub pull request: #58262

Props to @jsnajdr for writing the dev note.

Introducing theย block_core_navigation_listable_blocksย 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.

WordPress 6.5 introduces a new filter,ย block_core_navigation_listable_blocksย which is designed to provide control over the accessible rendering of child blocks used within the Navigation block.

Historically, the Navigation block has conditionally wrapped particular blocks inย <li>ย tags to ensure accessible markup on the front of the site.

With the introduction of the newย allowedBlocksย API, which technically allowsย anyย block to be added as valid children of the Navigation block, developers require a means to indicate which blocks need to be wrapped.

Theย block_core_navigation_listable_blocksย filter allows developers to determine whether a specific block should be wrapped in anย <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.), thereby aiding in adherence to 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) standards and the creation of valid markup.

The example below shows theย mycustomblock/iconย block opting into being wrapped in anย <li>ย tag:

function add_icon_block_to_navigation_listable_blocks( $blocks ) {
$blocks[] = 'mycustomblock/icon';
return $blocks;
}
add_filter( 'block_core_navigation_listable_blocks', 'add_icon_block_to_navigation_listable_blocks' );

GitHub pull request: #55551

Props to @get_dave for writing the dev note.

Add new selectors to fetch entity revisions

Two new selectors have been introduced to Block Editorโ€™s Core Data API to fetch revisions and single revisions for post types that support revisions, for example, posts and pages, templates, and global styles.

getRevisions( kind, name, recordKey, query ) โ€“ fetches a postโ€™s revisions where recordKey is the id of the parent post.

getRevision(kind, name, recordKey, revisionKey, query) โ€“ fetches a single post revision, where revisionKey is the id of the individual revision.

The functions use similar arguments to existing core data entity functions, such asย getEntityRecordsย with the addition ofย recordKeyย (post parent id) andย revisionKeyย (single revision id).

Example usage:

// Returns a collection of revisions.
// `parentGlobalStylesId` is the id (int) of the parent post.
wp.data.select( 'core' ).getRevisions( 'root', 'globalStyles', parentGlobalStylesId, { per_page: -1 } );
 
// Paginated results.
// `parentId` is the id (int) of the parent post.
wp.data.select( 'core' ).getRevisions( 'postType', 'post', parentId, { per_page: 3, page: 2 } )
 
// Get a single revision object.
// `parentId` is the id (int) of the parent post.
// `revisionId` is the id (int) of the individual revision post.
wp.data.select( 'core' ).getRevision( 'postType', 'post', parentId, revisionId );
 
 
// Get a single revision with only the id, parent and date fields.
// `parentId` is the id (int) of the parent post.
// `revisionId` is the id (int) of the individual revision post.
wp.data.select( 'core' ).getRevision( 'postType', 'post', parentId, revisionId, { _fields: 'id,parent,date' } );

getRevisionsย andย getRevisionย can also be used viaย useSelectย in ReactReact React is a JavaScript library that makes it easy to reason about, construct, and maintain stateless and stateful user interfaces. https://reactjs.org components:

import { useSelect } from '@wordpress/data';
import { store as coreStore } from '@wordpress/core-data';

function MyComponent() {
    const pageRevisions = useSelect(
        ( select ) =>
            select( coreStore ).getRevisions( 'postType', 'page', pageId ),
        [ pageId ]
    );
    // Do something with pageRevisions...
}

In the background, these selectorsโ€™ corresponding resolvers call revisionsย REST API endpoints.

GitHub pull request: #54046

Props to @ramonopoly for writing the dev note.

Newย useSettingsย hook for reading block instance settings

When trying to improve the block editorโ€™s performance for WordPress 6.5, one of the identified issues was related to theย useSettingย hook that is used by block instances to read various settings provided by the environment they are in: parent blocks, the theme, the block editor itself. It turns out that itโ€™s inefficient to read multiple settings with separateย useSettingย calls:

const allowFixed = useSetting( 'position.fixed' );
const allowSticky = useSetting( 'position.sticky' );

The editor performance is improved when all the settings are read at once using a new hook calledย useSettings:

const [ allowFixed, allowSticky ] = useSettings( 'position.fixed', 'position.sticky' );

Thatโ€™s why WordPress 6.5 introduces this new hook. Theย useSettingย (singular) hook is now deprecated (using it will trigger a console warning), because reading even a single setting is very easy with theย useSettingsย (plural) hook:

const [ allowFixed ] = useSettings( 'position.fixed' );

The only change is that theย useSettingsย hook always returns an array, and the array needs to be destructured to read the single value. Supporting two APIs for performing the same task is therefore not justified.

GitHub pull request: #55337

Props to @jsnajdr for writing the dev note.

Introduction of the PluginPostExcerpt Slot Component

This update introduces a new PluginPostExcerpt slot component within 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/ editor. This enhancementenhancement Enhancements are simple improvements to WordPress, such as the addition of a hook, a new feature, or an improvement to an existing feature. allows for the extension of the 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. panel, allowing developers to customize this area for their needs.

Whatโ€™s New?

The component enables the addition of custom content within the Post Excerpt panel. This is particularly useful for plugins looking to add extra functionality or information specific to their use case.

Usage

To utilize this new feature, developers can now insert their custom content into the Post Excerpt panel by creating a component that leverages the slot. This allows for a seamless integration of custom functionalities directly within the editor.

The following example shows adding custom content to the post excerpt panel.

import { PluginPostExcerpt } from '@wordpress/edit-post';
import { __ } from '@wordpress/i18n';

const MyPluginPostExcerpt = () => (
  <PluginPostExcerpt
    className="my-plugin-post-excerpt"
  >
    { __( 'Post excerpt custom content' ) }
  </PluginPostExcerpt>
);

GitHub pull request: #55200

Props to @retrofox for writing the dev note.

Changes to the underlyingย Compositeย component implementation

WordPress 6.5 no longer includes theย Reakitย package, as it does not support React beyond v16. Theย __unstable*ย Composite componentย was built on this library, so it has been internally refactored.

What does this mean for consumers?

The primary API has not changed, and can still be imported with no changes. For typical usage patterns, there should be no differences, and in most cases, no action is required from consumers of the package.

However, composite state propsย mustย now be generated by theย useCompositeStateย hook; they can no longer be provided by independent state logic.ย Composite state argumentsย have not changed, though, and will continue to work as before.

import {
  __unstableComposite: Composite,
  __unstableCompositeGroup: CompositeGroup,
  __unstableCompositeItem: CompositeItem,
  __unstableUseCompositeState: useCompositeState
} from '@wordpress/components';

const state = useCompositeState({ ... });

// โœ… This will continue to work
...( <Composite { ...state } /> );

// โ›”๏ธ This will no longer work
...( <Composite { ...state } currentId={ ... } /> );

Consumers can continue to either spread the state or pass as a singleย stateย prop.

// โœ… Used by spreading the state
...(
  <Composite { ...state }>
    <CompositeGroup { ...state }>
      <CompositeItem { ...state }>
        { ... }
      </CompositeItem>
    </CompositeGroup>
  </Composite>
);

// โœ… Or with a single `state` prop
...(
  <Composite state={ state }>
    <CompositeGroup state={ state }>
      <CompositeItem state={ state }>
        { ... }
      </CompositeItem>
    </CompositeGroup>
  </Composite>
);

Because the shape of the returned composite state has changed, consumers can also now no longer destructure specific state props fromย useCompositeState.

// โœ… This will continue to work
const state = useCompositeState({ ... });

// โ›”๏ธ This will no longer work
const { groups, items } = useCompositeState({ ... });

Whatโ€™s next?

We anticipate a new stableย Compositeย component to be released in WordPress 6.6, along with the deprecation of this unstable version.

GitHub pull request: #58620

Props to @andrewhayward for writing the dev note.

Deprecated components

Deprecatingย isPressedย inย Buttonย component

Theย isPressedย prop on theย Buttonย component implicitly setsย aria-pressed, with no way to override it. But sometimesย Buttonย is used for roles other thanย button, such asย optionย andย checkbox, whereย aria-pressedย is not appropriate, and workarounds are required to add the correct semantics.

In an effort to move away from custom props that have native HTMLHTML HyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. equivalents, and to allow greater flexibility in component usage,ย aria-pressedย is now supported as a first-class prop, taking precedence overย isPressed.

GitHub pull request: #54740

Props to @andrewhayward for writing the dev note.

Outer Margins Deprecation

A number of UI components currently ship with styles that give them top and/or bottom margins. This can make it hard to reuse them in arbitrary layouts, where you want different amounts of gap or margin between components. To better suit modern layout needs, we are in the process of deprecating these outer margins

A few releases ago, we deprecated the outer margins on a number of components and introduced transitional props so consumers could opt into these new styles before they become the default:

  • AnglePickerControl:ย __nextHasNoMarginBottom
  • CustomGradientPicker:ย __nextHasNoMargin
  • FontSizePicker:ย __nextHasNoMarginBottom
  • GradientPicker:ย __nextHasNoMargin

In WordPress 6.5, these margin-free styles have become the default. Any use of these props can be safely removed.

GitHub pull request: #58699, #58700, #58701, #58702

Props to @mikachan for writing the dev note.

CustomSelectControl deprecation

CustomSelectControlย used to have a hard-coded width, which was inconsistent with our other form components. In WordPress 6.1, we deprecated this unconstrained width, and introduced the transitionalย __nextUnconstrainedWidthย prop so consumers could opt into these new styles before they become the default.

In WordPress 6.5, these unconstrained width styles have become the default. Any use of theย __nextUnconstrainedWidthย prop can be safely removed.

GitHub pull request: #58974

Props to @mikachan for writing the dev note.

Remove deprecation warnings for __next36pxDefaultSize

A few releases ago, we introduced aย __next36pxDefaultSizeย prop on several components, meant to coordiate the transition to a new default sizing scheme (36px height). Due to some changes in our design direction, we eventually dropped this prop in favor of theย __next40pxDefaultSizeย prop (40px height), making all existing opt-ins to theย __next36pxDefaultSizeย prop act as an opt-in to the 40px one.

After receiving developer feedback about this ahead of WordPress 6.5, we will no longer throw a deprecation warning for usages of theย __next36pxDefaultSizeย prop, informing consumers of this change. Do note, however, that it will trigger the new 40px size rather than the 36px size, despite the prop name.

GitHub pull request: #58703

Props to @mikachan for writing the dev note.

Remove unusedย buttonBehaviorย attribute from the Search block

The Search block had a buttonBehavior attribute, which was referenced internally to determine the display variations of the block. However, this attribute was removed because it could not be changed from the user interface, and the default value was always referenced.

With this change, this attribute will no longer be referenced even if it has been added manually.

GitHub pull request: #53467

Props to @wildworks for writing the dev note.

Setting to disable custom content size controls

Similar to the setting that allows disabling layout controls inย WP 6.4, this allows only the content and wide size controls for a constrained layout to be disabled from 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. file, globally or at a per-block level.

To disable the control globally for all blocks, add the following in theme.json underย settings.layout:

"allowCustomContentAndWideSize": false

To disable at the block level, add the following in theme.json underย settings.blocks:

"core/group": {
"layout": {
"allowCustomContentAndWideSize": false
}
}

Props to @isabel_brison for writing the dev note.


Props to @fabiankaegy and @bph for reviewing the post

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

Miscellaneous developer changes in WordPress 6.5


Table of contents


Administration

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

The default cursor style has been adopted for labels when its associated form controls are disabled, which improves accessibilityAccessibility Accessibility (commonly shortened to a11y) refers to the design of products, devices, services, or environments for people with disabilities. The concept of accessible design ensures both โ€œdirect accessโ€ (i.e. unassisted) and โ€œindirect accessโ€ meaning compatibility with a personโ€™s assistive technology (for example, computer screen readers). (https://en.wikipedia.org/wiki/Accessibility). (59733)

Bootstrap/Load

Two new functions have been introduced to check whether WordPress is serving a REST APIREST API The REST API is an acronym for the RESTful Application Program Interface (API) that uses HTTP requests to GET, PUT, POST and DELETE data. It is how the front end of an application (think โ€œphone appโ€ or โ€œwebsiteโ€) can communicate with the data store (think โ€œdatabaseโ€ or โ€œfile systemโ€) https://developer.wordpress.org/rest-api/ request: wp_is_serving_rest_request() and wp_is_rest_endpoint(). Both functions should only be used after the parse_request action. A new filterFilter Filters are one of the two types of Hooks https://codex.wordpress.org/Plugin_API/Hooks. They provide a way for functions to modify data of other functions. They are the counterpart to Actions. Unlike Actions, filters are meant to work in an isolated manner, and should never have side effects such as affecting global variables and output. wp_is_rest_endpoint has been added to alter the return value of the wp_is_rest_endpoint() function. (42061)

Canonical

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

Editor

A new metadata global attribute has been added, which is needed for scenarios such as allowing the user to assign custom names to blocks, or for making BlockBlock Block is the abstract term used to describe units of markup that, composed together, form the content or layout of a webpage using the WordPress editor. The idea combines concepts of what in the past may have achieved with shortcodes, custom HTML, and embed discovery into a single consistent API and user experience. HooksHooks In WordPress theme and development, hooks are functions that can be applied to an action or a Filter in WordPress. Actions are functions performed when a certain event occurs in WordPress. Filters allow you to modify certain functions. Arguments used to hook both filters and actions look the same. work with user-modified templates/parts/patterns. (59797)

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

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

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

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

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

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

The capabilitycapability Aย capabilityย is permission to perform one or more types of task. Checking if a user has a capability is performed by the current_user_can function. Each user of a WordPress site might have some permissions but not others, depending on theirย role. For example, users who have the Author role usually have permission to edit their own posts (the โ€œedit_postsโ€ capability), but not permission to edit other usersโ€™ posts (the โ€œedit_others_postsโ€ capability). to parse CSSCSS Cascading Style Sheets. custom properties for fontSize and fontFamily has been added in WP_Style_Engine. (59982)

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

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

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

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

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

Emoji

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

General

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

Media

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

Rest API

Terms can be assigned when creating attachments. (57897)

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

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

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

Shortcodes

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

Sitemaps

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

Themes

A new โ€˜theme_filesโ€˜ cache group, setup as a global cache group, has been added to block pattern caches. On a multisitemultisite Used to describe a WordPress installation with a network of multiple blogs, grouped by sites. This installation type has shared users tables, and creates separate database tables for each blog (wp_posts becomes wp_0_posts). See also network, blog, site networknetwork (versus site, blog), there will now be a single cache for block pattern data per theme, which allows block pattern caches to be shared between sites on a network and result in less repeated data in the object cache. (60120)

Users

Profile page color palettes:

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

Styles and scripts that target selectors such as table.color-palette or .color-palette td may need to be updated. To support WordPress versions both before and after this change, a pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party. can use the new .color-palette-shade class:

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

Props to @sabernhardt for the dev notedev note Each important change in WordPress Core is documented in a developers note, (usually called dev note). Good dev notes generally include a description of the change, the decision that led to this change, and a description of how developers are supposed to work with that change. Dev notes are published on Make/Core blog during the beta phase of WordPress release cycle. Publishing dev notes is particularly important when plugin/theme authors and WordPress developers need to be aware of those changes.In general, all dev notes are compiled into a Field Guide at the beginning of the release candidate phase..
(53157)

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

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

Unblocking WP6.5 – Font Library and Synced Pattern Overrides

A number of contributors have flagged a stalemate on a couple of different topics for WP6.5 this week. I want to first thank everyone who joined in the discussions on GithubGitHub GitHub is a website that offers online implementation of git repositories that 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 by the repository owner. https://github.com/, 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/, and elsewhere. There were a lot of well-reasoned and important concerns raised and it was an excellent example of the way open sourceOpen Source Open Source denotes software for which the original source code is made freely available and may be redistributed and modified. Open Source **must be** delivered via a licensing model, see GPL. works in the open. Over the last few days, Iโ€™ve discussed the suggested approaches with several coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. and core-editor contributors, including pros, cons, and side effects. Weโ€™ve reached a consensus on a path forward on both the Font Library and the issue with Synced Pattern Overrides.

Font Library

The font library portion of this post has been superseded by the post WordPress 6.5 release delayed 1 week, in which itโ€™s announced fonts will be uploaded to the fonts sub-directory of the uploads folder.

Letโ€™s ship the Font Library in WordPress 6.5 contingent on the following, which meet all the criteria and offers a good compromise:

  • The Font Library will use wp-content/fonts as the default storage folder. While locating fonts at the same level as themes and plugins gives fonts a lot of prominence, itโ€™s worth noting 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 are heading toward composability, allowing users to change collections of fonts, patterns, templates, and color schemes without switching the full theme. Storing fonts at the same level as themes is the first step to breaking down themes in these composable pieces and establishing new first-class concepts and objects within our software.
  • For installations that donโ€™t support modification of the wp-content directory, the Font Library will use wp-content/uploads/fonts as a fallback location, ensuring we stay true to our project philosophy of designing for the majority while still making the feature available to anyone out of the box without extra steps from the user.ย 
  • The wp_get_font_dir()โ€ƒ(source) is available to return the location of the siteโ€™s fonts folder. Extenders should use this function as it will allow them to seamlessly integrate with the Font Library regardless of their installed version of WordPress. This allows WordPress to manage the preferred directory location and any factors related to migrating folder locations (e.g., consolidating any remaining installations using wp-content/uploads/fonts to use wp-content/fonts)ย in future versions without extenders also needing to make changes.
  • For very edge cases, a font_dir 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.โ€ƒ(source) still allows overriding the font storage folder.
  • Like wp-content/uploads itself, the fonts directory will not adhere to wp_is_file_mod_allowed / DISALLOW_FILE_MODS to prevent font uploads.
  • The dev notedev note Each important change in WordPress Core is documented in a developers note, (usually called dev note). Good dev notes generally include a description of the change, the decision that led to this change, and a description of how developers are supposed to work with that change. Dev notes are published on Make/Core blog during the beta phase of WordPress release cycle. Publishing dev notes is particularly important when plugin/theme authors and WordPress developers need to be aware of those changes.In general, all dev notes are compiled into a Field Guide at the beginning of the release candidate phase. will reflect these changes upon publication.

The following is still to be explored after WP 6.5:

  • A means to move the canonical location of the fonts directory. Should the wp-content directory become writable for a site, a safe path forward should be offered for its owners.
  • Related checks will be added to Site Health.
  • A roadmap will be published outlining where the project components are headed in relation to establishing new first-class concepts outside of previously established paradigms within the software (like breaking down themes into fonts, patterns, templates, etc.). Why was this such an important and impactful decision? And how might it present itself again in the future?

Synced Pattern Overrides

During beta a change was merged that switches how blocks are named and marked as overridable patterns. This is proving to have unforeseen side effects that need further research and testing. Given that we need to focus on the solution outlined above for the Font Library, letโ€™s revert this and try again in WP6.6.

Letโ€™s do it!

While there may still be some disagreement about these decisions, I ask that we all support this fair and reasonable compromise to ensure the release is ready for all to enjoy the Font Library feature that many contributors have worked so hard on over the last few years. Sticking to our philosophies is important, but we must balance that with releasing early and often. Weโ€™re not perfect, and the only way to know how is to release features for all to use.

Props to @priethor, @desrosj, @swissspidy, @cbringmann, @dd32, @youknowriad

#6-5

Summary, Dev Chat, March 6, 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.

Announcements

WordPress 6.5 RC 1ย was released on March 5, 2024. Thanks to everyone involved and those who helped test.

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.5

There are several important changes to our normal development process during the 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). stage. For more, see this post: WordPress 6.5 Release Candidate Phase.

Please continue to test the 6.5 release. See this list ofย key features to test, which was published alongside WP 6.5ย 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.ย 3.

During the meeting, @marybaum confirmed the release team for RC2, scheduled for next Tuesday, March 12, 2024. @akshayar will host, @davidbaumwald will run Mission Control (MC), and @audrasjb will be the committercommitter A developer with commit access. WordPress has five lead developers and four permanent core developers with commit access. Additionally, the project usually has a few guest or component committers - a developer receiving commit access, generally for a single release cycle (sometimes renewed) and/or for a specific component. (with @hellofromtonya as a backup).

Nextย 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/ย release: 17.9

Gutenberg 17.9ย is scheduled for release on March 13 and will includeย these issues.

Discussion

The discussion topic for today centered on: how can we make it easier to follow the decision process of major decisions across the project? This was originally raised by @marybaumย and there is some background discussionย here.

The discussion starts here in Slack. There were no clear next steps identified, but a summary of topics raised include:

  • We could consider having a way to share more regular status updates for primary features in a release in order to surface key decisions, request feedback, get more visibility of concerns raised, etc.
  • When key decisions need to be made, how can we ensure the context is easily accessible?
  • We should be careful about not adding more noise to the CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. Team blogblog (versus network, site) during an already busy release period.
  • When key decisions are made, they should be documented in an appropriate place that is easy to reference (e.g., GitHubGitHub GitHub is a website that offers online implementation of git repositories that 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 by the repository owner. https://github.com/, TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress., Core Team blog, etc.)

Highlighted posts

The full list of posts from the last week in Core can be read on the agenda at this link.

Open floor

Due to time, we did not have time for open floor this week.

Props to @mikachan for reviewing.

#6-5, #dev-chat, #summary

A Week in Core โ€“ March 4, 2024

Welcome back to a new issue ofย Week inย CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress.. Letโ€™s take a look at what changed onย TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress.ย between February 26 and March 4, 2024.

  • 49 commits
  • 70 contributors
  • 54 tickets created
  • 9 tickets reopened
  • 102 tickets closed

Ticketticket Created for both bug reports and feature development on the bug tracker.ย numbers are based on theย Trac timeline for the period above. The following is a summary of commits, organized by component and/or focus.

Code changes

Build/Test Tools

  • Add initial tests for the WP_Filesystem_Directclass โ€“ #57774
  • Fix the precommit:emojiscript โ€“ #60520, #57600
  • Update 3rd-party GitHubGitHub GitHub is a website that offers online implementation of git repositories that 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 by the repository owner. https://github.com/ Actions โ€“ #59805
  • Use a consistent parameter name between rand_str()and rand_long_str()โ€“ #60401
  • Address capitalization and docblockdocblock (phpdoc, xref, inline docs) inconsistencies in some test class names โ€“ #59647
  • Correct capitalization and fix typos in some test class names โ€“ #59647
  • Expand wp_parse_id_list()unit tests โ€“ #60218, #60217, #59647
  • Use assertSame()in post 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. revisioning tests โ€“ #59655

Bundled Theme

  • Fix focus outline in Twenty Twenty-Four in the editor โ€“ #60535

Coding Standards

  • Remove some extra trailing spaces โ€“ #60021
  • Apply some changes after composer formatโ€“ #60233, #60506, #60524

Customize

  • 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): Label menu subitems when updating menus โ€“ #32728

Docs

  • Add missing @globalmention in wp_interactivity()โ€“ #60677, #59651
  • Correct the placement of @globaltags in wp-includes/admin-bar.phpโ€“ #60021
  • Document some globals in wp-admin/setup-config.phpโ€“ #60021
  • Document some globals in wp-settings.phpโ€“ #60021
  • Document the $postglobal in comment feed templates โ€“ #60021
  • Document the $xmlrpc_loggingglobal in logIO()โ€“ #60021
  • Document the usage of $_paused_pluginsand $_paused_themesglobals โ€“ #60021
  • Improve docblock for WP_Block_Patterns_Registry::registerโ€“ #59532
  • Update WP_Query::tax_querydocblock to reflect that the property can be nullโ€“ #60563

Editor

  • Prevent infinite loops when filtering the font library folder โ€“ #60652
  • Simplify sanitization code path in WP_Theme_JSONafter [57496] โ€“ #60360
  • Update Packages with the latest 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 for 6.5 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 โ€“ #60315, #60665
  • do not expose protected post meta fields 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. bindings โ€“ #60651
  • Interactivity 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.: Rename data_wp_context()to wp_interactivity_data_wp_context()โ€“ #60575
  • Interactivity API: Rename data_wp_context()to wp_interactivity_data_wp_context()โ€“ #60575
  • Interactivity API: Revert [57742] pending a 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/ package update โ€“ #60575

General

  • Revert r57698 for WP_List_Util::pluck() โ€“ #59774
  • Use capital cased singular for Site Icon โ€“ #60686

HTMLHTML HyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. API

  • Ensure that breadcrumbs are properly retained after seeking โ€“ #58517, #60687
  • HTML API: Remove superfluous type-coercing empty() check

Help/About

  • Add images to the About page โ€“ #60303

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.

  • Cast magic MO marker number to integer โ€“ #60678
  • Improve docs for pomo library classes โ€“ #44424

Media

  • Accessibility: Copy attachment properties on site icon crop โ€“ #60524
  • Use consistent spacing for the media toolbar in both grid and list view โ€“ #43904

Plugins

  • Fix an overlap issue with 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. cards dependencies notice โ€“ #60501
  • Improve plugin dependency adminadmin (and super admin) notices โ€“ #60465
  • Improve plugin dependency related error messages โ€“ #60465
  • Plugin Dependencies: Donโ€™t assume API response has a slugproperty โ€“ #60540

Privacy

  • Update default privacy page content to use latest block markup โ€“ #60530

Query

  • Remove leading whitespace from certain database queries โ€“ #56841

Quick/Bulk Edit

  • Ensure the โ€œAllโ€ checkbox is properly toggled in certain scenarios โ€“ #59121

Toolbar

  • Polish design and code combining duplicate profile links โ€“ #43633, #34668

Props

Thanks to the 70 people who contributed to WordPress Core on Trac: @swissspidy (18), @sabernhardt (10), @costdev (8), @shailu25 (4), @upadalavipul (4), @huzaifaalmesbah (4), @joedolson (4), @youknowriad (4), @audrasjb (3), @afragen (3), @peterwilsoncc (3), @gziolo (3), @viralsampat (3), @afercia (3), @mukesh27 (3), @euthelup (2), @desrosj (2), @wildworks (2), @subrataemfluence (2), @cbravobernal (2), @ankitmaru (2), @westonruter (2), @luisherranz (2), @darerodz (2), @rcreators (2), @mmaattiiaass (2), @spacedmonkey (2), @ironprogrammer (2), @oglekler (2), @knutsp (1), @jonsurrell (1), @benjamin_zekavica (1), @richtabor (1), @laurlittle (1), @johnbillion (1), @seusmaniqbal (1), @ianbelanger (1), @pooja1210 (1), @sumitbagthariya16 (1), @devmuhib (1), @tmatsuur (1), @manooweb (1), @get_dave (1), @talldanwp (1), @kraftbj (1), @jorbin (1), @santosguillamot (1), @xknown (1), @wpfed (1), @tadamarketing (1), @harsh175 (1), @designsimply (1), @celloexpressions (1), @kushang78 (1), @hiteshtalpada (1), @webcommsat (1), @ugyensupport (1), @chaion07 (1), @Toru (1), @254volkan (1), @poena (1), @pbearne (1), @SergeyBiryukov (1), @pbiron (1), @pento (1), @hrshahin (1), @dd32 (1), @jamescollins (1), @thekt12 (1), and @joemcgill (1).

Congrats and welcome to our 5 new contributors of the week: @rcreators, @seusmaniqbal, @tadamarketing, @kushang78, @hiteshtalpada โ™ฅ๏ธ

Core committers: @swissspidy (12), @sergeybiryukov (11), @audrasjb (6), @desrosj (5), @joedolson (3), @youknowriad (3), @dmsnell (2), @davidbaumwald (1), @ryelle (1), @jorbin (1), @antpb (1), @costdev (1), @hellofromtonya (1), and @joemcgill (1).

#6-5, #core, #week-in-core

New Feature: The Block Bindings API

WordPress 6.5 is introducing a new way of extending blocks that substantially reduces the custom code needed to integrate different kinds of data 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.

This can now be done through the new Block Bindings 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..

What is the Block Bindings API?

Given a coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. block, rather than displaying a userโ€™s inline written content inside of it, imagine wanting to populate that block with data from a particular source instead. For example, the post metadata or custom PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 7.4 or higher logic. What would be the process for doing that?

Screenshot showing a heading and paragraph in the Gutenberg editor, with a large red arrow pointing to the paragraph. The paragraph reads: "How would you replace this sentence with data from somewhere else?"

This is actually a trick question: In previous versions of WordPress, you were unable to do this with 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/โ€™s core blocks โ€” it would instead require creating a custom block with particular logic for reading from the source in question. But this is no longer the case.

With the Block Bindings API, you can now bind core blocks to read from different sources without needing to write custom block boilerplate โ€” this means it is possible to bind a Paragraph to read from a postโ€™s metadata, or a Heading to read from 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.โ€™s PHP logic, all without needing to deal with ReactReact React is a JavaScript library that makes it easy to reason about, construct, and maintain stateless and stateful user interfaces. https://reactjs.org, block registration, and other particulars of writing custom blocks from scratch for each new source you want to read from.

This initial release of the Block Bindings API in WordPress 6.5 is a big step towards simplifying the process of extending the editor and expanding the capabilitiescapability Aย capabilityย is permission to perform one or more types of task. Checking if a user has a capability is performed by the current_user_can function. Each user of a WordPress site might have some permissions but not others, depending on theirย role. For example, users who have the Author role usually have permission to edit their own posts (the โ€œedit_postsโ€ capability), but not permission to edit other usersโ€™ posts (the โ€œedit_others_postsโ€ capability). of blocks. Under the hood, the API already powers a showcase feature being shipped in WordPress 6.5 alongside it: Connecting core blocks to custom fields in the post metadata.

Using the same functionality, as an advanced use case, it is also possible to define and have blocks read from custom sources โ€” more on that briefly below.

Note: For a more detailed walkthrough on creating and using Block Bindings than can be related in this brief dev notedev note Each important change in WordPress Core is documented in a developers note, (usually called dev note). Good dev notes generally include a description of the change, the decision that led to this change, and a description of how developers are supposed to work with that change. Dev notes are published on Make/Core blog during the beta phase of WordPress release cycle. Publishing dev notes is particularly important when plugin/theme authors and WordPress developers need to be aware of those changes.In general, all dev notes are compiled into a Field Guide at the beginning of the release candidate phase., see the Introducing Block Bindings tutorial from the WordPress Developer Blogblog (versus network, site).

How do block bindings work?

Overview

Before getting into the rich functionality Block Bindings can enable via custom sources, this section will first review how the API works in general, then detail how to bind core blocks to custom fields in the post metadata.

The following table shows the current compatible blocks and attributes that can be bound:ย 

Supported BlocksSupported Attributes
Imageurl, alt, title
Paragraphcontent
Headingcontent
Buttonurl, text, linkTarget, rel

While the list of compatibility is short for now, this already enables a wide range of use cases, and support for the rest of the core blocks, as well as custom blocks, is planned for the future.

To use Block Bindings, you would specify that these attributes should be read from particular registered sources using the block markup; the logic for those sources would then be executed when rendering on the frontend.

Upon being bound, editing of the attribute in question will be locked and indicators will appear in the editor to signal that the binding has been created.

Screenshot of the Gutenberg editor; a paragraph is selected and there are icons in the block toolbar, as well as a purple outline around the paragraph, declaring the block as bound.

Specifically, here is how to make use of this via the built-in custom fields support.

Custom fields

Importantly, in this first version of the Block Bindings API, there is no UIUI User interface for binding attributes to custom fields yet. Therefore, it is necessary to add the markup manually using the Code Editor in Gutenberg.

To bind a supported attribute to a custom fieldCustom Field Custom Field, also referred to as post meta, is a feature in WordPress. It allows users to add additional information when writing a post, eg contributorsโ€™ names, auth. WordPress stores this information as metadata. Users can display this meta data by using template tags in their WordPress themes. in the post metadata, you would use markup such as the following:

<!-- wp:paragraph {
"metadata":{
"bindings":{
"content":{
"source":"core/post-meta",
"args":{
"key":"book-genre"
}
}
}
}
} -->
<p></p>
<!-- /wp:paragraph -->

In order for this to work, you would need to make sure the field is registered to the post metadata by including code such as the following in the themeโ€™s functions.php or a plugin.

register_meta(
'post',
'book-genre',
array(
'show_in_rest' => true,
'single' => true,
'type' => 'string',
'default' => 'Default text field',
)
);

*Note that the show_in_rest property must be set to true for the time being due to security considerations, though there are plans to explore how to remove this requirement in the future.

Future sources

Support for post metadata is just a start, and the plan is to add more built-in sources, such as site, user, and taxonomyTaxonomy A taxonomy is a way to group things together. In WordPress, some common taxonomies are category, link, tag, or post format. https://codex.wordpress.org/Taxonomies#Default_Taxonomies. data, for WordPress 6.6.

That being said, the Block Bindings API already has the functionality to allow for registering of custom sources as well, which is the same functionality used internally to register the core/post-meta source above.

Registering a custom source

Overview

To register a Block Bindings source, one needs to use the register_block_bindings_source() function, which has the following signature:

register_block_bindings_source(
string $source_name,
array $source_properties
);

There are two available parameters:

  • $source_name: A unique name for the custom binding source in the form of namespace/slug. The namespace is required.
  • $source_properties: An array of properties to define the binding source:
    • label: An internationalized text string to represent the binding source. Note: this is not currently shown anywhere in the UI.
    • get_value_callback: A PHP callable (function, closure, etc.) that is called when a blockโ€™s bound attribute source matches the $source_name parameter.
    • uses_context: (Optional) Extends the block instance with an array of contexts if needed for the callback. For example, to use the current post ID, it should be set to [ 'postId' ].

When WordPress encounters the custom bindings source while parsing a block, it will run the get_value_callback function, whose signature should look like this:

projectslug_bindings_callback(
array $source_args,
WP_Block $block_instance,
string $attribute_name
);

It can accept up to three parameters, though you donโ€™t need to include them unless your logic requires them:

  • $source_args: An array of arguments passed via the metadata.bindings.$attribute.args property from the block.
  • $block_instance: The current instance of the block the binding is connected to as a WP_Block object.
  • $attribute_name: The current attribute set via the metadata.bindings.$attribute property key on the block.

Using the Registration Mechanism

In practice, here is how you might use the above registration function to create a simple binding for copyright information:

add_action( 'init', 'projectslug_register_block_bindings' );

function projectslug_register_block_bindings() {
register_block_bindings_source( 'projectslug/copyright', array(
'label' => __( 'Copyright', 'projectslug' ),
'get_value_callback' => 'projectslug_copyright_binding'
) );
}

function projectslug_copyright_binding() {
return '&copy; ' . date( 'Y' );
}

And here is how you would bind a paragraph to the copyright source in the block markup, and how it would look on the frontend:

<!-- wp:paragraph {
"metadata":{
"bindings":{
"content":{
"source":"projectslug/copyright"
}
}
}
} -->
<p>Copyright Block</p>
<!-- /wp:paragraph -->
A screenshot of a post titled "Block Bindings Copyright Example"; in the content is a copyright symbol and the year 2024.

Of course, this is a simple example, and you could make use of the other parameters in the callback signature to create more extensive logic.

Additional API functions

Additionally, there are a few other functions currently part of the public API:

  • unregister_block_bindings_source( $string source_name ): Unregisters a source
  • get_all_registered_block_bindings_sources(): Gets all registered sources
  • get_block_bindings_source( $string source_name ): Retrieves a registered source

Also, please note that while the core sources use shared APIs in the editor UI, be aware that these editor APIs will remain private for the time being while discussion continues on how to standardize extensions to the UI around this feature.

This means that if you would like to implement a UI to handle your custom fields easily, for now, you will need to create that functionality yourself.

Further learning and next steps

For more inspiration on how to use Block Bindings in your own projects, see the registration logic in block-bindings.php and the built-in core/post-meta source, and take a look at the Introducing Block Bindings tutorial series.

With that in mind, Block Bindings are just getting started, and future plans include:

  • Add the possibility of editing the value of the metaMeta Meta is a term that refers to the inside workings of a group. For us, this is the team that works on internal WordPress sites like WordCamp Central and Make WordPress. fields directly from the UI.
  • Add UI to allow users to add bindings through the Editor.
  • Create new built-in sources: Site data, post data, and taxonomy data.
  • Add support for more core blocks.
  • Add the ability for developers to extend the Editor UI.

As always, feedback is more than welcome, and we invite you to share your ideas and use cases on Github, this post, or WordPress 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/ to help shape the development of the Block Bindings API.

A big thanks to @greenshady for providing code snippets and the initial ideas for this post, as well as @santosguillamot, and @czapla for offering their feedback.

#6-5, #block-bindings, #dev-notes, #dev-notes-6-5

WordPress 6.5 Release Candidate Phase

Now that WordPress 6.5 has entered 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). phase, the following policies are in place.

These policies mainly cover how and when CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. committers can commit. For non-committing contributors, this post may help explain why a Core committercommitter A developer with commit access. WordPress has five lead developers and four permanent core developers with commit access. Additionally, the project usually has a few guest or component committers - a developer receiving commit access, generally for a single release cycle (sometimes renewed) and/or for a specific component. makes a certain decision.

String Freeze

To allow the Polyglots teamPolyglots Team Polyglots Team is a group of multilingual translators who work on translating plugins, themes, documentation, and front-facing marketing copy. https://make.wordpress.org/polyglots/teams/ time to get their local languageโ€™s translationtranslation The process (or result) of changing text, words, and display formatting to support another language. Also see localization, internationalization. of WordPress ready, no new strings are permitted to be added to the release. Existing strings can be removed and/or duplicated if needed.

Seek guidance from the Polyglots team leadership for any strings reported as buggy. A buggy string is one that can not be translated to all languages in its current form.ย 

Tickets on the WordPress 6.5 milestone

For the remainder of the cycle, only two types of tickets may be placed on/remain on the 6.5 milestone:

  • Regressions: bugs that have been introduced during the WordPress 6.5 development cycle, either to existing or new features.
  • Test suite expansion: tests can be committed at any time without regard to code or string freezes. This can cover either new or existing features.

Trunktrunk A directory in Subversion containing the latest development code in preparation for the next major release cycle. If you are running "trunk", then you are on the latest revision. is now WordPress 6.6-alpha

WordPress 6.5 was recently forked to its own branchbranch A directory in Subversion. WordPress uses branches to store the latest development code for each major release (3.9, 4.0, etc.). Branches are then updated with code for any minor releases of that branch. Sometimes, a major version of WordPress and its minor versions are collectively referred to as a "branch", such as "the 4.0 branch"., trunk is now open for commits for the next version of the software.

Backporting to the 6.5 branch

Backporting commits of production code (that is, anything that ends up in the zip file) now requires double sign-off by two core committers. The dev-feedback keyword should be used to request a second committerโ€™s review, dev-reviewed should be added to indicate a second committer has reviewed and approved the commit to the 6.5 branch.

Commits to the test suite do not require double sign-off.

@props to @swissspidy for peer review.

Agenda, Dev Chat, Wednesday March 6, 2024

The next WordPress Developers Chat will take place onย  Wednesday March 6, 2024 at 20:00 UTC in theย coreย channel onย Make WordPress Slack.

The live meeting will focus on the discussion of proposals and releases, updates on 6.5, and have an open floor section.

Additional items will be referred to in the various curated agenda sections, as below. If you haveย ticketticket Created for both bug reports and feature development on the bug tracker.ย requests for help, please do continue to post details in the comments section at the end of this agenda.

Announcements

WordPress 6.5 RC 1 was released on March 5, 2024. Thanks to everyone involved and those who helped test.

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.5

Updates from the release squad can be shared in the Dev Chat.

Please continue to test the 6.5 release. See this list of key features to test, which was published alongside WP 6.5 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. 3.

Next 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/ release: 17.9

Gutenberg 17.9 is scheduled for release on March 13 and will include these issues.

Discussions

This week the discussion will focus on any priority topics that need to be raised before the next 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). for WordPress 6.5.

Proposed topics

  • Are there any priority topics needed for discussion ahead of WordPress 6.5 RC 2?
  • How can we make it easier to follow the decision process of major decisions across the project?
  • Should we reduce the number of leads on a release squad?

Feel free to suggest additional topics related to this release in the comments.

Highlighted posts

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

Props to @annezazu for helping to collate this list.

Tickets for assistance

Tickets for 6.5 will be prioritized.
Please include detail of tickets / PR and the links into comments, and if you intend to be available during the meeting if there are any questions or will be async.

Open floor

Items for this can be shared in the comments.

#6-5, #agenda, #dev-chat

Performance Chat Summary: 5 March 2024

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

Announcements

  • Welcome to our new members ofย #core-performance
  • WordCampWordCamp WordCamps are casual, locally-organized conferences covering everything related to WordPress. They're one of the places where the WordPress community comes together to teach one another what theyโ€™ve learned throughout the year and share the joy. Learn more.ย Asia is this week
  • Updated agenda format to matchย CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress.ย dev chat as suggested in previous chats
  • Reminder on timezone difference for the next 3 weeks, this chat will remain at 16:00 UTC, then it will switch to 15:00 UTC from April 2

Priority Items

Structure:

  • WordPress performanceย TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress.ย tickets discussion
  • Performance Labย 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 other performance plugins) discussion
  • Active priority projects
    • Plugin checker
    • Improve template loading
    • INP opportunities research

WordPress Performance Trac Tickets

  • For WordPress 6.5:
    • @joemcgill The only open ticketticket Created for both bug reports and feature development on the bug tracker. we still have in the milestone isย #60127, which can happen at any time. @thelovekeshย was planning on taking a pass at this soon.
      • The only other thing that I think weโ€™ve been aware of is that this release is showing a slightly higher TTFB than 6.4, but we can discuss that in more detail later.
    • @thelovekesh tried to replicate the issue on 6.4 but facing some issues with local setup. Will try to set it up again.
  • For Future Releases:
    • We already haveย 15 items in the 6.6 milestone, but itโ€™s a good time for folks to start thinking about what they are wanting to focus on for the next release.

Performance Lab Plugin (and other Performance Plugins)

  • @flixos90 There has been a lot of progress on the unbundling of Performance Lab (seeย overview issue)
  • https://github.com/WordPress/performance/pull/1011 and https://github.com/WordPress/performance/pull/1019 are close to being merged into trunk
  • While that would in principle set us up to ship the 3.0 release, there have been a few conversations on the UXUX User experience of the new screen that deserve more attention. There is a lot to unpack, but it falls into 2 categories at a high level:
    • 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. from modules to plugins is a confusing user experience.
    • The PL screen itself, with the plugins and modules to activate, is a confusing user experience.
  • The first point affects a one-time functionality, as it was recently decided that the concept of modules will be permanently removed. In other words, this migration will never need to happen again. As itโ€™s already released and users are already migrating, it is not worth investing time to improve it
  • For the screen itself though, there is things we can do.
    • Most importantly, it would be more intuitive to make the experience about theย features, rather than theย plugins. As in, each card should describe a feature, instead of focusing on the technicality that itโ€™s a plugin. We shouldnโ€™t pull down .org information, but instead provide more solution driven feature descriptions. Things like the star ratings and other things related to the underlying plugin donโ€™t need to be shown.
      • Under the hood, enabling a feature will still install and activate the corresponding plugin. But that shouldnโ€™t matter for the user, their focus should be on the actual features.
    • We need to think about a better onboarding experience, e.g. a step which allows enabling all recommended features at once. There used to be modules which are activated by default, which is no longer possible now that the features are in the form of standalone plugins. So we need a solution to make that intuitive, which goes hand in hand with a better onboarding experience.
  • @thelovekesh suggested Maybe showing some on-boarding wizard? Where user can select what they want to improve in terms of performance on their site?
    • @flixos90 Potentially. I usually think of multiple steps when I think โ€œonboarding wizardโ€, so not sure thatโ€™s needed here. But at least it would need to be a dedicated screen, or a customized version of the regular
  • @joemcgill Iโ€™m definitely in favor of the first point above, and see the second as a โ€œnice to haveโ€. Do we already have a GH issue to track this discussion?
  • The most immediate course of action because of those additional points regarding theย Performance Lab pluginย unbundling: Because of the additional discussion and engineering required, I think we should postpone the 3.0 release. Hopefully only to April. We need to make sure the UX is good enough before we ship it, but at the same time we want to minimize the time we remain in this limbo where theย 2.xย branchbranch A directory in Subversion. WordPress uses branches to store the latest development code for each major release (3.9, 4.0, etc.). Branches are then updated with code for any minor releases of that branch. Sometimes, a major version of WordPress and its minor versions are collectively referred to as a "branch", such as "the 4.0 branch". andย trunkย are so diverged, as that complicates shipping potential fixes in the existing code.

Active Priority Projects

Plugin Checker

  • No updates this week

Improve template loading

INP research opportunities

  • No updates this week

Open Floor

Our next chat will be held on Tuesday, March 12, 2024 at 16:00 UTC in the #core-performance channel in Slack.

#core-performance, #performance, #performance-chat, #summary