Bug Scrub Schedule for 6.1

With 6.1 well underway, here’s the initial schedule of 6.1 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. scrub sessions. These 6.1-specific ticketticket Created for both bug reports and feature development on the bug tracker. scrubs will happen each week until the final release.

Alpha Scrubs:

Hosted by @audrasjb:

Hosted by @chaion07:

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

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). Scrubs:

Check this schedule often, as it will change to reflect the latest information.

What about recurring component scrubs and triagetriage The act of evaluating and sorting bug reports, in order to decide priority, severity, and other factors. sessions?

The above 6.1 scheduled bug scrubs are separate and in addition.

For your reference, here are some of the recurring sessions:

Have a recurring component scrub or triage session?
PingPing The act of sending a very small amount of data to an end point. Ping is used in computer science to illicit a response from a target server to test it’s connection. Ping is also a term used by Slack users to @ someone or send them a direct message (DM). Users might say something along the lines of “Ping me when the meeting starts.” @audrasjb or @chaion07 on SlackSlack Slack is a Collaborative Group Chat Platform https://slack.com/. The WordPress community has its own Slack Channel at https://make.wordpress.org/chat/. to have it added to this page.

Want to lead a bug scrub?

Did you know that anyone can lead a bug scrub at anytime? Yes, you can!

How? Ping @audrasjb or @chaion07 on slack and let us know the day and time you’re considering as well as the report or tickets you want to scrub.

Planning one that’s 6.1-focused? Awesome! It can be added to the schedule above. You’ll get well deserved props in the weekly Dev Chat, as well as in the #props Slack channel!

Where can you find tickets to scrub?

  • Report 5 provides a list of all open 6.1 tickets:
    • Use this list to focus on highest priority tickets first.
    • Use this list to focus on tickets that haven’t received love in a while.
  • Report 6 provides a list of open 6.1 tickets ordered by workflow.

Need a refresher on bug scrubs? Checkout Leading Bug Scrubs in the coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. handbook.

Questions?

Have a question, concern, or suggestion? Want to lead a bug scrub? Please leave a comment or reach out directly to @audrasjb or @chaion07 on slack.

#bug-scrub

Editor chat summary: 12 October 2022

This post summarizes the weekly editor chat meeting (agenda here) held on Wednesday, October 12, 2022, 14:00 UTC in Slack. Moderated by @bph.

Announcements and Links

Gutenberg 14.3 was released

Key project updates

Mobile Team update by @siobhan

@ramonopoly shared an update in the comments

  • I’ve added a new tracking issue for Fluid typography and ongoing enhancements.
  • Work on the Style Engine has paused during 6.1. I’ll provide an update on planned iterations for 2022/23 in a future agenda.

Open Floor

 @tellthemachines commented last week:

  • I can’t be present at the chat because of timezones, but would like to bring up the “Key project updates” list in the agenda:
  • Is this approach working? How useful is it for folks?
  • How can we make sure to keep it up to date?

“Keeping it up to date well that can be a bit tricky as there is probably various amounts of work being done in each tracking issue each week.” – @paaljoachim

“It would be helpful if authors of tracking issues could on occasion drop by and give a general update of how a specific issue is coming along” – @paaljoachim


@KubiQ

“hi, i’m just testing WordPress 6.1-RC1-54503, and I still cannot see inner container in group 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.” referring to this issue, and that it was supposed to be merged for 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.

@wildworks discovered that it didn’t make it into RC 1, but is slated to be fixed in RC 2


@piermario

“I thought I’d bring up a request from @glorialchemica, which will be a speaker at 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. Italia 2022 and is preparing a talk about using patterns. She ran into a problem while trying to use patterns on a test site, and wrote a request on this channel, who that got unnoticed so far. Is there anybody who can look into this or direct her to the right channel she can ask about this?

“Sometimes I get the problem when I try to use a pattern or block going from an older site to a new site. now I don’t know which version the pattern directory is running on. So, the next steps I would suggest, file an issue / 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. report on 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/ repo. Answer all the questions in the issue template. Then check out when the next 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. team meeting is also DM me when it’s posted, so I can take another look and see if I can reproduce” — @bph

“The error should be shown in the browser console, so it might be a good idea to submit an issue with the error message, WordPress version, your theme” — @wildworks


To get more details go directly to the Open Floor discussions in the CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. Editor 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/. channel.

Props to @paaljoachim for review

#core-editor, #core-editor-summary, #gutenberg, #meeting-notes, #summary

What’s new in Gutenberg 14.3? (12 October)

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


Gutenberg 14.3 has been released and is available for download!

It continues to build on recent writing flow improvements, refines image 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. creation via drag-n-drop, adds an enhanced tools panel to the Styles interface, and much more!

Table of Contents

Quickly navigate blocks of text

Continuing on from the improvements to writing flow in the last release. Gutenberg 14.3 includes support for alt + arrow keyboard combinations to make navigating blocks of text a breeze.

For example, if your cursor is towards the end of a long paragraph, you can quickly press alt + up arrow to move to the beginning of that paragraph. If you are already at the beginning of a text block, you’ll move to the start of the previous paragraph. Similarly, alt + down arrow will move you to the end of a block of text.

Improved drag and drop for images

As of Gutenberg 14.3, you can now drop an image onto an empty paragraph block to replace it with a new Image block.

Improved tools panels for the Styles typography controls

Building on past releases, Gutenberg 14.3 now brings the Tools Panels to the Styles interface. This makes the Styles interface consistent with the Block Settings interface, but it also makes it more usable by being able to reset values and opens the door to adding hidden-by-default controls, too!

Changelog

Enhancements

Post Editor

  • Optimize legacy post content layout. (44506)
  • Remove right border when sidebars are closed. (44613)

Block Library

  • Comment Pagination Numbers: Add background color. (43902)
  • Navigation Submenu: Use get_queried_object_id when setting current-menu-item classes. (44474)
  • Post Author: Include option to link author archive. (42670)
  • Post Terms: Add spacing support. (43646)
  • Query LoopLoop The Loop is PHP code used by WordPress to display posts. Using The Loop, WordPress processes each post to be displayed on the current page, and formats it according to how it matches specified criteria within The Loop tags. Any HTML or PHP code in the Loop will be processed on each post. https://codex.wordpress.org/The_Loop.: Hide instructions for FormTokenField. (44641)
  • Tag Cloud: Remove strtolower around 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. name. (16112)
  • Video: Update placeholder style. (44215)

Components

  • FontSizePicker: Make control take up full width. (44559)
  • Placeholder: Remove unnecessary background color. (44497)
  • Placeholder: Update placeholder style. (44190)
  • ToggleGroupControl: Fix unselected icon color. (44575)
  • ToolsPanel: Add subheadings and reset text to tools panel menu. (44260)

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.

  • Blocks: Deprecate non-string descriptions. (44455)
  • Tag Processor: Document and test XSS prevention in set_attribute. (44447)
  • Tag Processor: Throw error when supplied with unacceptable attribute names. (44431)
  • Tag Processor: Use (start,length) values for tracking tag name. (44479)
  • Tag processor: Update ‘since’ version tags to 6.2.0. (44432)

Global Styles

  • Hide the done button of the Global Style palette editor when there aren’t colors to edit. (44372)
  • Use ToolsPanel in Global Styles → Typography. (44180)

Block Editor

  • Allow dropping an image on an empty paragraph block to create an image block. (42722)
  • Writing flow: Implement Alt+Arrow. (44081)

Site Editor

  • Allow drag and drop for blocks and patterns in zoom-out mode. (44402)

Block Directory

  • Use ‘tertiary’ in missing block warning. (44368)

New APIs

Block Library

  • WP_HTML_Tag_Processor: Inject dynamic data to block HTMLHTML HyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. markup in PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 5.6.20 or higher. (42485)

Bug Fixes

  • Add a correct TS signature for useEntityRecords. (44448)
  • BlockDraggable: Change prop name passed to children when dragging is disabled. (44371)
  • Fix Lint warning/errors in cherry-pick script. (44662)
  • Fix: Content blocks with nested blocks always appear as top level. (44098)
  • Hide the Classic block in the Site Editor. (44554)
  • PHP 8.2: Remove deprecated callable in Style Engine value functions. (44561)
  • Persisted preferences: Fix context property of user metaMeta Meta is a term that refers to the inside workings of a group. For us, this is the team that works on internal WordPress sites like WordCamp Central and Make WordPress. configuration. (44489)
  • Resizable editor: Fix height setting 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.. (44637)
  • Style engine: Kebab case preset slugs in the editor. (44406)
  • Add submenu block href only if URLURL A specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org is not empty. (44337)
  • Update 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. $schema to allow pseudo selectors on button property. (44303)
  • Preserve the generic signature of getEntityRecord and getEntityRecords through currying. (44453)
  • Template editor: Fix crashes due to undefined vars. (44482)
  • Add missing value to CSSCSS Cascading Style Sheets. font-display descriptor in theme.json. (44622)
  • Rich text: Avoid updating partial selection unnecessarily. (44330)
  • useMergeRefs: Don’t call/mutate refs passed if unused. (44629)

Block Library

  • Code Block: Add box-sizing to fix inconsistent layout. (44580)
  • Comment Author: Fix empty links created for the author’s name. (44650)
  • Comments: Support nested comments settings in the comments blocks. (44351)
  • Group: Legacy Group inner block wrapper should work with a constrained layout. (44660)
  • Image: Fix rotated image crop area aspect ratio. (44425)
  • Image: Upgrade reactReact React is a JavaScript library that makes it easy to reason about, construct, and maintain stateless and stateful user interfaces. https://reactjs.org/.-easy-crop to bring in fix for site editor iframeiframe iFrame is an acronym for an inline frame. An iFrame is used inside a webpage to load another HTML document and render it. This HTML document may also contain JavaScript and/or CSS which is loaded at the time when iframe tag is parsed by the user’s browser.. (44408)
  • Navigation: Fix console error. (44594)
  • Navigation: Fix semitransparent burger icon. (44525)
  • Navigation: Try fixing link color in some TT2 contexts. (44578)
  • Paragraph: Disable drop cap control if text is aligned. (42326)
  • Post Featured ImageFeatured image A featured image is the main image used on your blog archive page and is pulled when the post or page is shared on social media. The image can be used to display in widget areas on your site or in a summary list of posts.: Fix borders after addition of overlay feature. (44286)
  • Post Featured Image: Fix application of default border style in editor. (44520)
  • Query Loop: Fix condition for displaying ‘parents’ control. (44630)
  • Query Loop: Rename Query Loop variations allowControls to allowedControls. (44523)
  • Quote block: Stop slash inserter popup showing in the citation. (44634)
  • Site Title: Fix link color not being applied in editor #37071. (44333)
  • Template part: Prevent adding block in post editor or inside post template or content blocks. (44480)
  • Video: Don’t display placeholder SVG when Video block selected. (44564)

Global Styles

  • Fix empty color indicator with a custom style. (44364)
  • Re-add styles that were removed for classic themes. (44334)
  • Remove border from Global Styles previews. (44556)
  • Spacing presets: Modify the styling of the input controls when in unlinked mode in order to better differentiate sides. (44141)
  • Style cards: Fix focus style. (44612)
  • Theme.json: Fix some shadow properties not working properly in the site editor. (44569)
  • Use color hex + index as key in the Palette component color indicator. (44344)

Design Tools

  • Fix padding/margin visualizer accuracy. (44485)
  • Fix padding/margin visualizer placement. (44484)
  • Fix spacing property generation in flow layout type. (44446)

Components

  • BorderBoxControl: Ensure the most common unit selection is maintained. (44565)
  • Popover: Fix limitShift logic by adding iframe offset correctly (and a custom shift limiter). (42950)
  • Popover: Refine position-to-placement conversion logic, add tests. (44377)
  • Navigator Screen: Fix bug where focus moved erroneously. (44239)

Block Editor

  • Fix block search for non-Latin characters. (44652)
  • Prevent empty block toolbars from showing empty slots. (44704)

Widgets Editor

  • Add extra guarding against legacy widgetWidget A WordPress Widget is a small block that performs a specific function. You can add these widgets in sidebars also known as widget-ready areas on your web page. WordPress widgets were originally created to provide a simple and easy-to-use way of giving design and structure control of the WordPress theme to the user. preview errors. (44635)

Themes

  • Theme export: Fix broken spacingScale export. (44555)
  • Theme export: Stop slugs being cast to integers when a theme is exported. (44589)

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)

  • TokenInput field: Try alternative approach to fix screen reader focus issue. (44526)

Patterns

  • Fix patterns drag and drop in Safari. (44366)

Post Editor

  • Add layout styles from Post Content block to post editor. (44258)

Performance

  • Compose: Introduce an in-house throttle() utility, deprecate Lodash version. (44225)
  • Improve Slot/Fill performance. (44642)

Documentation

  • Add documentation for extending the Query Loop block via variations. (44137)
  • Add more details about possible values for block assets in block.json. (44199)
  • Add missing import statement for useBlockProps. (44607)
  • Instruct people to keep using wp-scripts even when extending webpack. (44348)
  • Style engine: Updating and fleshing out documentation. (44405)
  • Style engine: Update readme. (44308)
  • Add callout for experimental packages. (44056)
  • Expand class-level documentation for WP_HTML_Tag_Processor. (44478)
  • Experiments: Add README.md and CHANGELOG.md. (44457)
  • Remove the package name from the sub-menu item for clarity. (44643)

Code Quality

  • Avoid calling get_blocks_metadata in WP_Theme_JSON constructor. (44658)
  • Block Popover: Use placement instead of position; move to useBlockToolbarPopoverProps hook. (44323)
  • CS/QA: Various minor fixes. (44551)
  • CS: Always use parentheses when instantiating objects. (44550)
  • CS: Remove redundant parentheses for include/require statements. (44544)
  • CS: Use pre-increment instead of post-increment. (44549)
  • Fix comment typo in document generation tools. (44583)
  • 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.: Use consistent string: ‘Link rel’. (20162)
  • PHP 8.2 | Fix deprecated embedded variables in text strings. (44538)
  • PHP 8.2 | Fix for partially supported callback. (44537)
  • PHPCSPHP Code Sniffer PHP Code Sniffer, a popular tool for analyzing code quality. The WordPress Coding Standards rely on PHPCS.: Use PHPCompatibilityWP. (44542)
  • QA: No control structures with empty body. (44548)
  • Script loader: Remove 6.1 wp actions. (44519)

Components

  • Components refactor Mobile to ignore exhaustive-deps. (44207)
  • Convert FontSizePicker to TypeScript. (44449)
  • FontSizePicker: Replace SCSS with Emotion + components. (44483)
  • RangeControl: Remove unused UseDebouncedHoverInteractionArgs type. (44411)
  • Refactor Notice to pass exhaustive-deps. (44157)
  • Refactor ResizableBox to pass exhaustive-deps. (44370)
  • Refactor Sandbox to pass exhaustive-deps. (44378)
  • Refactor SearchControl native files to ignore exhaustive-deps. (44381)

Block Library

  • Archive Block: Remove unnecessary spaces from class attributes. (44440)
  • Archive: No need to escape class variable. (44468)
  • Gallery: Remove unnecessary caption state. (44383)
  • Remove unnecessary view.js file from navigation-submenu block. (44570)

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

  • CS: All methods must declare visibility. (44543)
  • Move wp_enqueue_block_view_script to experiments. (44414)

Layout

  • Backportbackport A port is when code from one branch (or trunk) is merged into another branch or trunk. Some changes in WordPress point releases are the result of backporting code from trunk to the release branch. code quality changes from coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. to Gutenberg. (44661)

Parsing

  • Block Serialization Default Parser: Bring back no-more-tokens type. (44459)

Global Styles

  • Add blocks to the list of valid origins for theme.json. (44363)

Lodash

  • Lodash: Remove completely from @wordpress/compose package. (44568)
  • Lodash: Remove completely from @wordpress/library-export-default-webpack-plugin package. (44571)
  • Lodash: Remove completely from @wordpress/list-reusable-blocks package. (44567)
  • Lodash: Refactor away from _.flow(). (44500)
  • Lodash: Remove completely from @wordpress/block-directory package. (44206)
  • Lodash: Remove completely from @wordpress/rich-text package. (44204)

Tools

  • Scripts: Use default value for process.env.WP_SRC_DIRECTORY. (44367)
  • Limit access to experimental APIs to WordPress codebase. (43386)
  • Cherry Pick Script: Restore retrieval of merge_commit_sha. (44890)

Testing

  • Autocomplete Component: Add end-to-end tests (take two). (42905)
  • Fix failing quote to reusable block conversion end-to-end test. (44350)
  • Add strict meta schema validation test for block.json. (44423)
  • Migrate iframed block test to Playwright. (44164)
  • Add theme.json schema tests. (44252)
  • Remove enzyme completely. (44494)
  • Fix typo from in writing flow spec. (44358)
  • Fix typo in WP_Navigation_Page_Test. (44685)
  • Popover: Convert unit tests to TypeScript and modern RTL assertions. (44373)
  • Refactor AlignmentMatrixControl tests to use @testing-library/react. (44670)
  • End-to-end Test Utils: Don’t use hardcoded login credentials. (44331)
  • Refactor PluginPostPublishPanel tests to use RTL render. (44667)
  • Refactor AutosaveMonitor tests to @testing-library/react. (44492)
  • Refactor PostPreviewButton tests to @testing-library/react. (44470)
  • Refactor BlockSwitcher tests to @testing-library/react. (44493)
  • Refactor ResponsiveBlockControl tests to use @testing-library/react. (44669)
  • Style engine: Add JSJS JavaScript, a web scripting language typically executed in the browser. Often used for advanced user interfaces and behaviors. unit tests for outline properties. (44518)

Build Tooling

  • Upgrade Lerna to the latest version. (44456)
  • wp-env: Use case insensitive regex when checking WP version string. (44887)

Performance Benchmark

The following benchmark compares performance for a particularly sizeable post (~36,000 words, ~1,000 blocks) over the last releases. Such a large post isn’t representative of the average editing experience but is adequate for spotting variations in performance.

Post Editor

VersionLoading TimeKeyPress Event (typing)
Gutenberg 14.314.3s79.51ms
Gutenberg 14.212.6s76.31ms
WordPress 6.09.8s41.28ms

Site Editor

VersionLoading TimeKeyPress Event (typing)
Gutenberg 14.310.8s72.89ms
Gutenberg 14.210.3s66.83ms
WordPress 6.07.5s36.81ms

Contributors

The following contributors merged PRs in this release:

@aaronrobertshaw @adamziel @ajlende @alecgeatches @andrewserong @anton-vlasenko @BE-Webdesign @BenoitZugmeyer @blindingstars @carolinan @chad1008 @ciampo @derekblank @dmsnell @ellatrix @getdave @glendaviesnz @gziolo @imanish003 @inc2734 @jameskoster @jasmussen @javierarce @jorgefilipecosta @jrfnl @kevin940726 @loxK @Lucisu @luisherranz @Mamaduka @michalczaplinski @ndiego @noisysocks @ntsekouras @oandregal @pagelab @philwp @ramonjd @Rink9 @ryanwelcher @SantosGuillamot @scruffian @Soean @sunyatasattva @t-hamano @talldan @tellthemachines @tyxla @vcanales @youknowriad

The following PRs were merged by first time contributors:

  • @alecgeatches: Add theme.json schema tests. (44252)
  • @BenoitZugmeyer: Use get_queried_object_id when setting current-menu-item classes. (44474)
  • @blindingstars: Update Theme JSON $schema to allow pseudo selectors on button property. (44303)
  • @imanish003: Add missing import statement for useBlockProps. (44607)
  • @loxK: Scripts: Use default value for process.env.WP_SRC_DIRECTORY. (44367)
  • @Lucisu: Fix empty links being created for the author’s name comment. (44650)
  • @philwp: Post Author block now includes option to link author archive. (42670)

Kudos to all the contributors that helped with the release! 👏

Props to @talldanwp, @priethor, @getdave, and @gziolo for their assistance with the release, and props to @joen for the images and videos!

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

WordPress 6.1 Field Guide

WordPress 6.1 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). 1 is out and it’s time to take a look at what changes we can expect. Release squad and many contributors worked hard on both TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. and 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 be the repository owner. https://github.com/; with more than 120 enhancements and feature requests, 241 bug fixes, 42 other blessed tasks, which makes it over 400 tickets in Trac; and 50 Trac pull requests bringing 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/ changes into coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress.. In Gutenberg repo there were 1684 pull requests of which 425 new features and enhancements and 428 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, while the rest is tooling, testings, documentation, and code quality.

New release comes with massive performance improvements, 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) enhancements, first default 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. based themes marked as accessibility ready, new 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. and functions, private functions being open for public use and many more.

Performance

With 45 Trac tickets for 6.1, 19 components got various performance improvements. The most significant improvements arrived in WP_Query and 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/., which will impact a large portion of your next page load.

If there is one thing you take from performance updates, let it be caching queries in WP_Query. It’s been a long dream for many developers and, once you test it, it will be all that you hoped for. REST API is richer for several priming caches and lighter for prepare_links (if you want it). Site Health will check your Persistent Object Cache and Page Cache, while several private Cache 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. functions are now public. You’ll also be able to flush cache by group, declare supported cache features, validate cache keys and more.

Besides Query, REST API, Site Health, and Cache API, performance improvements can be found in 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, Bootstrap, Media, Post (Post Types), Editor, Database and many other components. There are too many changes to mention them all here, but you are invited to read the Field guideField guide The field guide is a type of blogpost published on Make/Core during the release candidate phase of the WordPress release cycle. The field guide generally lists all the dev notes published during the beta cycle. This guide is linked in the about page of the corresponding version of WordPress, in the release post and in the HelpHub version page. on performance improvements in WordPress 6.1.

Other performance improvements:

  • Posts, Post Types – Post title should not be translatable in get_user_data_from_wp_global_styles method. #55392
  • Quick/Bulk Edit – Check the show_in_quick_edit 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. property when processing the data for bulk edited posts. #42474
  • 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. – Use latest_id as the array key for the latest revision ID. #55857

Accessibility

Similar to performance, accessibility improvements arrive in 28 Trac tickets, spread over 13 components. We have first block-based bundled themes marked with accessibility ready 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.), Twenty Twenty-Three and Twenty Twenty-Two. Forms, site/template and block editors, administration screens and many more accessibility improvements are coming in with 6.1 release.

Block Editor

WordPress 6.1 is bringing 10 Gutenberg releases into core – 13.1, 13.2, 13.3, 13.4, 13.5, 13.6, 13.7, 13.8, 13.9, 14.0, and 14.1.

Among many changes in these 10 releases 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, a lot of effort was made in making blocks and other Gutenberg features more available in classic themes, which will ensure easier transition to hybrid and block-based themes.

New ways to extend various parts of block editor tools which were very much needed in everyday development, such as scaffolding block variants with create-block tool, content locking updates, filtering theme.json data, extending Query block, Style Engine, new ReactReact React is a JavaScript library that makes it easy to reason about, construct, and maintain stateless and stateful user interfaces. https://reactjs.org/. hooks for easier data access, and many more.

Themes

Themes are getting more control over styling elements, layout, and navigation while classic themes also get control over block-based template parts and theme.json. Read all about these in 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 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. below.

Updated Settings and Styles 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.

New server-side filters in WordPress 6.1 will allow hooking into theme.json data (see 56467 and 54251 for more info).

REST API

REST API gets nice improvements for /search endpoint as well as pretty-printing JSON responses, which can be added as query parameter but also controlled via rest_json_encode_options 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..

Administration

Login and Registration

Media

In 5.8 we welcomed support for WebP image format and excitement was high when generating WebP format was merged into core (54097, 54094, and 54086) for 6.1. However, this commit has been reverted in 54226 with recommendation of integrating the feature into the Canonical plugin.

Changes in #54788 allow for the muted property to be used in video elements, which solves for content that wishes to autoPlay when a page is viewed.

Database

A file containing the wpdb class is renamed from wp-includes/wp-db.php to wp-includes/class-wpdb.php to conform to the coding standards. If you’ve been including this file directly, do not worry – a new wp-db.php file is created and it’s loading the old, now renamed file. Read more in #56268.

Other developer updates

As mentioned above, WordPress 6.1 comes with a serious number of new hooks and functions, which will make Miscellaneous 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 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. very useful for theme and plugin developers.

But wait, there is more!

Application Passwords

Allow a Super Adminadmin (and super admin) to set an application password on a site they’re not a member of. #53224

Autosave

Block autosaving from overwriting changes when locked from editing. #55659

Cache API

Prevent excessive notoptions key lookups. #56639

Charset

Normalize to Unicode NFC encoding before converting accent characters in remove_accents()#35951

Cron API

  • Modify _get_cron_array() to always return an array. #53940
  • Add error logging and hooks to wp-cron.php. #56048

Editor

  • Universalize functions for checking block editor status. #51819
  • Clarify that get_page_template() doesn’t work on block themes. #56394
  • Block Patterns: Add new Footers categoryCategory The 'category' taxonomy lets you group posts / content together that share a common bond. Categories are pre-defined and broad ranging. #56416

External Libraries

Several external libraries have been updated to their latest versions. These include PHPMailer, GetID3, Moment, Sodium Compat, jQuery, jQuery UIUI User interface, MediaElement.js, Clipboard.js, and Underscore

  • Add support for WebP images in the Thickbox library. #55786
  • Update PHPMailer to 6.6.4 #55976, #56016, #56413
  • Update the Underscore library for 6.1 #56030
  • Update Moment library for 6.1 #56031
  • Update jQuery UI library for 6.1 #56239
  • Update mediaelement.js to version 4.2.17 #56319
  • Update jQuery to version 3.6.1 #56451
  • Update Sodium Compat to 1.19.0 #56564, #56653
  • Update GetID3 to version 1.9.22 #56692

Formatting

  • Normalize to Unicode NFC encoding before converting accent characters in remove_accents() #24661
  • Replace all esc_url_raw() calls in core with sanitize_url(). #55852
  • Allow min()max()minmax(), and clamp() values to be used in inline CSSCSS Cascading Style Sheets.. #55966
  • KSES: Allow more layout-related CSS properties. #56122
  • KSES: Allow assigning values to CSS variables. #56353

General 

  • Formatting: Add support for Enums in is_serialized(). #53299
  • Replace phpversion() function calls with PHP_VERSION constant. #55680
  • Blocks: Remove duplicate use of realpath() in register_block_style_handle(). #56636
  • Block Editor: Remove repetitive calls to file_get_contents() in block editor settings. #56637
  • General: Remove file_exists() checks after calling realpath(). #56654
  • Blocks: Remove extra get_theme_file_path() calls in register_block_style_handle(). #56666
  • General: Ensure wp_rand() returns 0 when $min and $max values are equal to 0. #55194

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.

I18N: Introduce WP_Textdomain_Registry to store text domains and their language directory paths. #39210 

Login and Registration

  • Required fields in networknetwork (versus site, blog) registration. #54344
  • Explicitly associate errors with input fields. #54483

Media

Respect EXIF Rotations. #54937

Networks and Sites

  • Move global_terms_enabled() to its proper final resting place. #21734 
  • Use metadata API in *_network_options` functions. #37181
  • Store main site ID of a network in network options. #55802

Posts, Post Types

Correct the check for non-existing post in get_post_permalink(). #45329

Script Loader

Ensure block script is enqueued, regardless of render_callback. #56470

Taxonomy

  • Standardise the format used to describe arguments passed to actions and filters inside wp_insert_term() and wp_update_term(). #55441
  • Set use_desc_for_title to false by default in wp_list_categories() #55530
  • Associate field descriptions with fields. #55651

Upgrade/Install

Track php extensions and image library support for WebP and AVIF. #48116

Widgets

Store default options for uninitialized widgets. #54677

Thanks to @sabernhardt, @bph, @jeffpaul, @desrosj, @webcommsat, @spacedmonkey, @sergeybiryukov and @audrasjb for peer review.

#6-1, #field-guide

Block API changes in WordPress 6.1

WordPress 6.1 introduces several 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. 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. features available via the block.json file.

As a recap, the block.json file was introduced in WordPress 5.5 and has been encouraged as the canonical way of registering block types since the WordPress 5.8 release. Many of the recent Block API features, including the ones in this post, depend on block.json being available on the server.

PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 5.6.20 or higher templates for rendering blocks

Before WordPress 6.1, the main output of a block would often be generated in either a JavaScriptJavaScript JavaScript or JS is an object-oriented computer programming language commonly used to create interactive effects within web browsers. WordPress makes extensive use of JS for a better user experience. While PHP is executed on the server, JS executes within a user’s browser. https://www.javascript.com/. save function, or in a PHP render_callback function.

WordPress 6.1 adds a third way: a separate PHP template file. The path can be specified via the render property of block.json:

{
    "render": "file:./render.php"
}

If you don’t have a render_callback setting specified, then the template is used instead. It behaves similarly, but feels much more like traditional WordPress template handling.

The template path is prefixed with file: and relative to the location of the block.json file, following the npm specification.

The render.php template could look like this:

<p <?php echo get_block_wrapper_attributes(); ?>>
    <?php esc_html_e( 'Hello from a dynamic block!', 'my-plugin' ); ?>
</p>

Note: The entire file is used as a template, so there’s no need to define additional wrapping functions.

The following variables are available inside the template:

  • $attributes (array): The block attributes.
  • $content (string): The block default content.
  • $block (WP_Block): The block instance.

Use multiple scripts per block

The WordPress 6.1 version enables defining multiple script files in all relevant block.json entries: editScript, script, and viewScript. (Trac #56408) It’s now possible to pass a script handle registered with the wp_register_script function, a path to a JavaScript file relative to the block.json file, or an array with a mix of both:

{
    "editorScript": "file:./index.js",
    "script": "file:./script.js",
    "viewScript": [ "file:./view.js", "example-shared-view-script" ]
}

WordPress maintains a degree of backwards compatibility by passing along only the first (string) item to any existing code working with these values.

Note: Processing a single string requires a different code than processing an array of strings. Therefore, the WP_Block_Type class and the /wp/v2/block-types 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/. endpoint deprecate accessing string values through their old names: editor_script, script, view_script, editor_style, and style.

The full array of scripts can be accessed via the following new properties of the WP_Block_Type class and the /wp/v2/block-types REST API endpoint:

  • editor_script_handles,
  • script_handles,
  • view_script_handles,
  • editor_style_handles, and
  • style_handles.

Furthermore, the scripts and styles registered in block.json will automatically be loaded for static and dynamic blocks in WordPress 6.1. Previously, the dynamic blocks were expected to register their assets.

Combined with the support for multiple stylesheets per block shipped with WordPress 5.9, this change enables developers to use multiple entries for all supported asset types.

Import individual coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. blocks from @wordpress/block-library

The import of individual core blocks (Pull request #42258) from the @wordpress/block-library npm package was enabled to help developers reduce the bundle size of their applications. Prior to this change, the use of a single core block required pulling in the entire set.

Individual core blocks can be imported in three different ways:

// You can import and automatically register the block:
import '@wordpress/block-library/build-module/verse/init';

// Or you can automatically register the block and reuse the reference:
import verseBlock from '@wordpress/block-library/build-module/verse/init';

// Or you can import the init function without registering the block…
import { init } from '@wordpress/block-library/build-module/verse';

// …and then register the block when needed:
const verseBlock = init();

Props to @gziolo, and @revgeorge for technical review, to @bph and @webcommsat for final review.

#6-1, #dev-notes, #dev-notes-6-1, #developer-documentation

Content only editing and other locking updates

WordPress 6.1 comes with content-only editing for blocks, patterns, and templates, as well as a template lock inheritance for the Column 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..

Almost any layout using the coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. blocks can be composed and shared as a pattern. End users may have found they could accidentally break these layouts or use them in an unexpected way. Previously, the experience of using patterns was not on par with having a specific block for a complex layout.

With WordPress 6.1, a new experimental type of locking has been added called “contentOnly”. This locking method can be used by any pattern or block. When enabled, the users can only change the nested content inside the block/pattern. The block structure starts behaving as a single unit where the block hierarchy is entirely hidden. The user can only change text and media URLs in the blocks. 

Additionally, block types without content are hidden from the List View and are unable to gain focus within the block list. This makes it harder to break the expected layout.

In locked mode, the inspector controls of the blocks are also disabled. Instead, the 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. only shows a list of content blocks a user can change.

For now, users still have the freedom to leave this locked mode by pressing modify. When modify is pressed, the block editor shows the hierarchy, and the user has complete control. For now, any user can press the modify button. In the future, it may depend on the capabilities of the user.

Content only editing in a block

The core blocks that support content locking are column, cover, and group.

To use content locking, the templateLock attribute of one of the previously referred blocks should be set to “contentOnly”.

In the following pattern, only the content of the paragraph blocks can be edited. A user would not view the spacer block in between.


Paragraph 1

Paragraph 2

Using as custom post-type template locking

The new content-only locking can also be used as custom post-type template locking, like all the other locking methods that exist.

Example:

function myplugin_register_template() {
    $post_type_object = get_post_type_object( 'post' );
    $post_type_object->template = array(
        array(
			'core/group',
			array(),
			array(
				array(
					'core/paragraph',
					array( 'placeholder' => 'Add Description...',
					)
				)
			)
		),
    );
    $post_type_object->template_lock = 'contentOnly';
}
add_action( 'init', 'myplugin_register_template' );

Visit pull request: #43037 and Block Template Documentation

Global template_lock inheritance in the column block

The block template defines a default list of blocks in an editor session. To prevent manipulation of the block list, all blocks can be locked by the template_lock property.

However, in column blocks, the editor would crash on certain operations because it would initialize the lock status defined in the block template. To resolve this issue and to be more consistent about template lock status inheritance, column blocks now inherit the lock status of block templates.

For more information visit #42677.

Props to @wildworks contribution, @bph and @webcommsat for reviews.

#6-1, #dev-notes, #dev-notes-6-1

Simplified data access with new React hooks in WordPress 6.1

The @wordpress/core-data JavaScriptJavaScript JavaScript or JS is an object-oriented computer programming language commonly used to create interactive effects within web browsers. WordPress makes extensive use of JS for a better user experience. While PHP is executed on the server, JS executes within a user’s browser. https://www.javascript.com/. package in 6.1 ships new ReactReact React is a JavaScript library that makes it easy to reason about, construct, and maintain stateless and stateful user interfaces. https://reactjs.org/. 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. that make accessing WordPress data easier than before.

useEntityRecords

With useEntityRecords developers, can fetch a list of records with a single hook call:

useEntityRecords( 'postType', 'page' )

Below is what it looks like when used in a React component:

import { useEntityRecord } from '@wordpress/core-data';
 
function PageTitlesList() {
   const pages = useEntityRecords( 'postType', 'page' );
 
   if ( pages.isResolving ) {
      return 'Loading...';
   }
 
   return (
      <ul>
         {pages.records.map(( page ) => (
            <li>{ page.title }</li>
         ))}
      </ul>
   );
};
 
// Rendered in the application:
// <PageTitlesList />

In the above example when PageTitlesList is rendered, the list of records and the resolution details will be retrieved from the store state using getEntityRecords(), or resolved if missing.

The useEntityRecords accepts four arguments:

  • kind (string) – Kind of the entity, e.g. root or a postType.
  • name (string) – Name of the entity, e.g. plugin or a post.
  • queryArgs (object) – Optional HTTPHTTP HTTP is an acronym for Hyper Text Transfer Protocol. HTTP is the underlying protocol used by the World Wide Web and this protocol defines how messages are formatted and transmitted, and what actions Web servers and browsers should take in response to various commands. query to pass to the requested 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. endpoint, e.g. { "per_page": 10 }
  • options (object) – Optional hook options. Currently, the only supported option is enabled and determines whether the records will be requested.

It returns an object with the following properties:

  • records (array) – The requested entity records
  • isResolving (boolean) – Are these records being resolved at the moment?
  • hasResolved (boolean) – Have these records resolved already?
  • status (string) – Resolution status. One of: IDLE, RESOLVING, SUCCESS, or ERROR

useEntityRecord:

Developers can retrieve a single record using the useEntityRecord hook:

import { useEntityRecord } from '@wordpress/core-data';

function PageTitleDisplay( { id } ) {
	const page = useEntityRecord( 'postType', 'page', id );

	if ( page.isResolving ) {
		return 'Loading...';
	}

	return page.title;
}

// Rendered in the application:
// <PageTitleDisplay id={ 13 } />

In the above example, when PageTitleDisplay is rendered, the page and the resolution details will be retrieved from the store state using getEntityRecord(), or resolved if missing.

The useEntityRecord hook accepts four arguments:

  • kind (string) – Kind of the entity, e.g. root or a postType.
  • name (string) – Name of the entity, e.g. plugin or a post.
  • recordId (string|number) – The ID of the requested entity record.
  • options (object) – Optional hook options. Currently, the only supported option is enabled and determines whether the records will be requested.

It returns an object with the following properties:

  • record (object|null) – The resolved entity record.
  • isResolving (boolean) – Is the record being resolved at the moment?
  • hasResolved (boolean) – Has the record already resolved already?
  • status (string) – Resolution status. One of: IDLE, RESOLVING, SUCCESS, or ERROR.
  • hasEdits (boolean) – Does the record have any in-browser edits?
  • editedRecord (object|null) – The record with any in-browser edits applied.
  • edit (function) – Applies the in-browser edits to the edited entity record.
  • save (function) – Persist the in-browser edits to the server.

Below is an example showcasing the editing capabilities provided by useEntityRecord:

import { useDispatch } from '@wordpress/data';
import { useCallback } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { TextControl } from '@wordpress/components';
import { store as noticeStore } from '@wordpress/notices';
import { useEntityRecord } from '@wordpress/core-data';
 
function PageRenameForm( { id } ) {
 	const page = useEntityRecord( 'postType', 'page', id );
 	const { createSuccessNotice, createErrorNotice } =
 		useDispatch( noticeStore );
 
 	const setTitle = useCallback( ( title ) => {
 		page.edit( { title } );
 	}, [ page.edit ] );
 
 	if ( page.isResolving ) {
 		return 'Loading...';
 	}
 
 	async function onRename( event ) {
 		event.preventDefault();
 		try {
 			await page.save();
 			createSuccessNotice( __( 'Page renamed.' ), {
 				type: 'snackbar',
 			} );
 		} catch ( error ) {
 			createErrorNotice( error.message, { type: 'snackbar' } );
 		}
 	}
 
 	return (
		<form onSubmit={ onRename }>
			<TextControl
				label={ __( 'Name' ) }
				value={ page.editedRecord.title }
				onChange={ setTitle }
			/>
			<button type="submit">{ __( 'Save' ) }</button>
		</form>
 	);
}
// Rendered in the application:
// <PageRenameForm id={ 1 } />

In the above example, updating and saving the page title is handled via the edit() and save() mutation helpers provided by useEntityRecord();

useResourcePermissions

Developers can check the current user’s permissions using the useResourcePermissions hook:

import { useResourcePermissions } from '@wordpress/core-data';

function Page({ pageId }) {
	const pagePermissions = useResourcePermissions( 'pages', pageId );

	if ( pagePermissions.isResolving ) {
		return 'Loading ...';
	}

	return (
        <div>
			{pagePermissions.canCreate
				? (+ Create a new page)
				: false}
			{pagePermissions.canUpdate
				? (Edit page)
				: false}
			{pagePermissions.canDelete
				? (Delete page)
				: false}
			// ...
        </div>
	);
}

// Rendered in the application:
// <Page pageId={ 15 } />

In the above example when the Page is rendered, the appropriate record-level page permissions and the resolution details will be retrieved from the store state using the canUser() selector, or resolved if missing.

In the following example, the PagesList component requests permissions for the pages collection and not a specific page record:

import { useResourcePermissions } from '@wordpress/core-data';

function PagesList() {
   const pagesPermissions = useResourcePermissions( 'pages' );

   if ( pagesPermissions.isResolving ) {
      return 'Loading ...';
   }

   return (
      <div>
         {pagesPermissions.canCreate
            ? (+ Create a new page)
            : false }
         // ...
      </div>
   );
}

// Rendered in the application:
// <PagesList />

The useResourcePermissions hook accepts two arguments:

  • resource (string) – The resource in question, e.g., media.
  • id (string|number) – Optional ID of a specific resource entry, e.g., 10.

It returns an object with the following properties:

  • status (string) – Resolution status. One of: IDLE, RESOLVING, SUCCESS, or ERROR
  • isResolving (boolean) – Is the record being resolved at the moment?
  • hasResolved (boolean) – Has the record already resolved?
  • create (boolean) – Can the current user create new resources of this type?
  • read (boolean) – Can the current user read resources of this type?
  • update (boolean) – Only if id is provided. Can the current user update the requested resource?
  • delete (boolean) – Only if id is provided. Can the current user delete the requested resource?

Documentation: @wordpress/core-data packages

Props for review @bph, @gziolo, and @webcommsat

#6-1, #wordpress-data, #dev-notes, #dev-notes-6-1, #editor

Dev Chat agenda, October 12, 2022

The meetings take place on Wednesdays at  20:00 UTC in the #core channel on Slack, and usually last an hour. All are welcome to attend or catch up via the summary.

About Dev Chat.

The publication of the Dev Chat agenda was held until after the WordPress 6.1 RC1 release party concluded to include the updates from this.

1. Welcome

Dev Chat summary, October 5, 2022 – thanks to @ndiego for writing, and @webcommsat and @marybaum for reviewing.

2. Announcements

WordPress 6.1 Release Candidate 1 is available to test.

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 14.3 is due to land on October 12. Its RC is already available.

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

A Week in Core, August 10, 2022

4. Forthcoming releases

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 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 6.1 are in process, going through tech and editorial review, and published as they are ready. Find them at the dev-notes-6-1 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.). The Field GuideField guide The field guide is a type of blogpost published on Make/Core during the release candidate phase of the WordPress release cycle. The field guide generally lists all the dev notes published during the beta cycle. This guide is linked in the about page of the corresponding version of WordPress, in the release post and in the HelpHub version page. will be out shortly. Thanks to the efforts led by the release docs team.

WordPress 6.1 Release Candidate 1 is available to test.

Note 1: Double sign-off is needed for tickets with milestone 6.1, no matter 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. or 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"./backportbackport A port is when code from one branch (or trunk) is merged into another branch or trunk. Some changes in WordPress point releases are the result of backporting code from trunk to the release branch.. Note 2: Trunk was not branched on October 11, 2022 following RC1.

If you have an update from release leads or any teams collaborating on related items, please add a comment.

5. Component maintainers updates / tickets / requests for help

Please add your request for tickets you would like to raise as a comment.

6. Open Floor

Please add your Open Floor item as a comment.

#6-1, #agenda, #dev-chat

Reference Styles values in theme.json

With WordPress 6.1, theme developers can style elements with references from other settings.

Theme designs often require consistency in the styles applied to blocks. This can be achieved by setting Styles properties which are inherited by blocks using the inheritance of the CSSCSS Cascading Style Sheets. cascade. In some cases blocks want to apply settings from Styles to a different property of 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. – for example the button element might want to use the global text color for its background color and the global background for its text color.

To solve this problem, themes need to be able to share Styles settings with blocks. This will make it easier for users to update these shared properties across all their blocks. Again, as example for button element the developer wants to use the text color for its background. If the button element is set up as in the example above, then when a user edits the global text color, the background color of their buttons will also be updated, too.

To achieve this, a new ref property was added to theme.jsonJSON JSON, or JavaScript Object Notation, is a minimal, readable format for structuring data. It is used primarily to transmit data between a server and web application, as an alternative to XML. which allows one property to set itself to the value of another, for example defining this for button elements:

"elements": {
	"button": {
		"color": {
			"background": {
				"ref": "styles.color.text"
			},
			"text": {
				"ref": "styles.color.background"
			}
		}
	}
}

Styles will convert {ref: "styles.color.background"} the value at: styles > color > background in theme.json.

Limitations

It is currently only possible to use ref to get one value from theme.json; a ref value cannot point to another ref. This also prevents circular refs from causing problems.

Props to @bph and @webcommsat for review of this post.

#6-1, #dev-notes, #dev-notes-6-1, #styles, #themes

WordPress 6.1 Accessibility Improvements

Thank you to @joedolson and @alexstine for collaborating to write this post.

With WordPress 6.1 around the corner, this post brings together the many 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) improvements and fixes to look forward to that might be hard to discover amongst the details of 500+ bugs and enhancements. As always, there’s more work to be done with accessibility requiring an ongoing effort and commitment. 

If you’re interested in helping with this work, please join the #accessibility channel in Make 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/. (need a slack account to view) and check out how you can get involved. There are numerous ways to get involved in this important work including testing, giving accessibility feedback, and creating PRs to address feedback.

Themes

Most notably, 6.1 will see the introduction of both Twenty Twenty-Two and Twenty Twenty-Three marked as accessibility ready, making them both the first default 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 to do so (and only default block themes). This helps open up more folks to the world of block themes and broader site editing features.

WP Adminadmin (and super admin) Screens

Across the many screens in WP Admin, improvements abound. Changes range from improvements in color contrast on 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 screen during recovery mode, to a switch from a text input to a textarea field in the media library, so users are better able to see the content of the field while editing. 

Login and Registration

To better call attention to the many improvements to this form, this section has been pulled out of the WP Admin Screen section. While this is a lesser used interface, the accessibility improvements are quite significant for this release, addressing many longstanding problems. This includes proper labels for required fields, explicitly associating errors with input fields so folks know what actions to take where, improved labels for radio buttons, and more. 

Site Editor/Template Editor

Even though the Site and Template editors both use blocks, there are some specific accessibility challenges for these new interfaces in a site editing world. More work is needed and, if you’re keen to help, please join the FSE Outreach Program where you can go through calls for testing to provide feedback, find bugs, and more. 

Navigation block

The navigation block continues to be a powerful and complex block, especially in the world of block themes. While there are fallbacks and an improved menu management experience to look forward to in this release, there is also a nice set of accessibility related fixes to make this necessary block usable for more people in more situations. 

General Block Editor (other blocks, writing flow, components, etc)

This section covers a wide range of items including everything from improvements to additional blocks, like a focus loss fix for the Table block, and larger improvements to functionality like the Tools Panel. Specifically, the Tools Panel helps power part of the experience of using the numerous design tools present in more blocks for this release. It’s what you’d interact with to interact with more tools or reset changes. Improving the accessibility of this single tool has a cascading impact by improving the experience everywhere it’s used.  

Comments

Comments now include proper contextual attributes for autocomplete fields, proper labels for the visible text describing required fields, and improved accessibility (and translatability) of the logged in as link.

#6-1, #accessibility, #dev-notes, #dev-notes-6-1

Miscellaneous REST API improvements in WordPress 6.1

Search REST resources by ID across subtypes

WordPress 6.1 includes an enhancementenhancement Enhancements are simple improvements to WordPress, such as the addition of a hook, a new feature, or an improvement to an existing feature. to the search controller, #56546, which makes it possible to retrieve a term or post object over 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/. without knowing anything but that resource’s ID and object type.

get_post can retrieve a post of any post type so long as you know the post’s numeric ID, and get_term can retrieve a term from any 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.. Because REST objects are segregated by post type-specific endpoints, however, there has not been a clear way to get a Post with ID 78 if you don’t know whether it is a page, post, or my-cpt.

The coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. /search endpoint now supports ?include and ?exclude parameters which take a list of IDs, and limit results to posts matching those IDs.

Examples:

  • To get post 78 when you don’t know its post type,
    • /wp/v2/search?include=78
  • To get posts 78 and 79 only if they are in the page post type,
    • /wp/v2/search?include=78,79&subtype=page
  • To search posts excluding post 78,
    • /wp/v2/search?exclude=78
  • To get term 87,
    • /wp/v2/search?type=term&include=78
  • To get term 87 only if it is a categoryCategory The 'category' taxonomy lets you group posts / content together that share a common bond. Categories are pre-defined and broad ranging.,
    • /wp/v2/search?type=term&include=78&subtype=category
  • To search terms excluding terms 87 and 88,
    • /wp/v2/search?exclude=87,88

The search endpoint supports the _embed 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. parameter, so developers can therefore use the search endpoint to retrieve a full post or term response object in one request knowing only those object’s IDs.

As an example of how this could be used, imagine a custom 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. which relates to a specific post. As of WordPress 6.1 developers can implement that block knowing only the related post’s ID, and could then create a hook to search for that post by ID and retrieve it using the Block Editor’s existing entity system:

/**
 * Dictionary of requested items: keep an in-memory list of the type (if known)
 * for each requested ID, to limit unnecessary API requests.
 */
const typeById = {};
​
/**
 * Query for a post entity resource without knowing its post type.
 *
 * @param {number} id Numeric ID of a post resource of unknown subtype.
 * @returns {object|undefined} The requested post object, if found and loaded.
 */
function usePostById( id ) {
    const type = typeById[ id ];
​
    useEffect( function() {
        if ( ! id || typeById[ id ] ) {
            return;
        }
​
        apiFetch( {
            path: `/wp/v2/search?type=post&include=${ id }&_fields=id,subtype`,
        } ).then( ( result ) => {
            if ( result.length ) {
                typeById[ id ] = result[0].subtype;
            }
        } );
    }, [ id ] );
​
    return useSelect( function( select ) {
        if ( ! id || ! type ) {
            return undefined;
        }
        return select( 'core' ).getEntityRecord( 'postType', type, id );
    }, [ id, type ] );
}

Pretty-printing REST endpoint 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. responses

WordPress 6.1 also introduces support for returning pre-formatted JSON from the REST API. #41998 lets developers request formatted JSON using a new _pretty query parameter or a 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., particularly useful when querying via curl or other tools which do not provide an option to format responses.

To format the JSON returned from a specific endpoint request, append the ?_pretty query parameter to the endpoint URLURL A specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org.

To instruct WordPress to pretty-print all REST response bodies, a developer can use the rest_json_encode_options filter:

function myproject_pretty_print_rest_responses( $options ) {
        $options |= JSON_PRETTY_PRINT;
​
        return $options;
}
add_filter( 'rest_json_encode_options', 'myproject_pretty_print_rest_responses', 10 );

A developer or site owner may also disable pretty-printing globally using the same filter:

function myproject_disable_rest_pretty_printing( $options ) {
        $options &= ~JSON_PRETTY_PRINT;
​
        return $options;
}
add_filter( 'rest_json_encode_options', 'myproject_disable_rest_pretty_printing', 10 );

Filters are applied after, and can override, the _pretty query parameter.

Thanks to @spacedmonkey for peer review.

#core-restapi, #dev-notes, #dev-notes-6-1, #rest-api