Wayback Machine
«SEP OCT NOV »
Previous capture 7 Next capture
«2020 2021 2022
0 captures
13 May 20 - 28 Feb 22
Close Minimize Help

WordPress.org

Welcome!

The WordPress core development team builds WordPress! Follow this site for general updates, status reports, and the occasional code debate. There’s lots of ways to contribute:

Communication

We use Slack for real-time communication. Contributors live all over the world, so there are discussions happening at all hours of the day.

Our core development meetings are every Wednesday at 20:00 UTC in the #core channel on Slack. Anyone can join and participate or listen in!

Make WordPress Core

Keyboard Shortcuts | Hide comment threads

What’s new in Gutenberg 11.6 (29 September)

Gutenberg 11.6 has been released! This release includes a number of nice enhancements and as usual many bug fixes.

Site Logo cropping and rotating within the editor

Before Gutenberg 11.6, the image used as the site logo had to be edited before being uploaded to your site. With the goal of providing a wide array of tools to adapt your logo without leaving the editor, it is now possible to crop, zoom, and rotate the image you choose for the site logo directly in the Site Logo block’s toolbar!

Locking control at block level

Alongside template level locking, now you can lock individual blocks to prevent moving or removing them; you can do this by adding a lock attribute on the block settings. Block-level lock takes priority over the templateLock feature and currently, you can lock moving and removing blocks.

The toolbar of locked blocks will have the movers hidden, and the Remove block option won’t be available either.

Query Pagination uses Flex Layout

Following previous releases bringing Flex Layouts to blocks, Gutenberg 11.6 improves the Query Pagination block to support the flex layout along with a justification option, for automatic best-fit.

Other Notable Highlights

Regarding Full Site Editing and Global Styles, basic support for child themes has been added. This means the Beta Site Editor is available when the child theme of a block theme is active, and its templates, template parts, and theme.json are inherited.

The writing flow has also received some enhancements in this release: the Richtext format toolbar now shows a visual clue for hidden active items and, when using the quick inserter and clicking the Browse all button, your current filter value is now passed to the main inserter without the need to type it again, making this switch between inserters seamless.

Template Part Focus Mode refers to the view that lets you focus and work on a single template part, like a header, and is available for any template part. This isolated template part editing is now accessible from the ellipsis menu in the Template Part toolbar. More Template Part Focus Mode improvements are coming soon, so make sure to check its tracking issue here.

11.6

Enhancements

Block Library

  • Post Title block: Add typography formatting options. (31623)
  • Query Pagination block: Use flex layout. (34876)
  • Site logo: Add site logo crop. (31607)
  • Cover: Move cover min-height into dimensions panel via SlotFill. (34065)
  • Group Block: Add information about selected element types for Group Block. (33976)
  • Image Block: Create two-way data binding for ImageSizeControl. (34649)
  • Columns Block: Update block description of columns block. (34705)
  • Gallery block: Add toolbar button to convert old galleries to new format. (34606)

Block Editor

  • Format toolbar: Visual clue for hidden active items. (21892)
  • Increase Link UI search results to 10 on the Navigation Editor screen. (34808)
  • Inserter: Pass filter value when clicking Browse All. (34912)

Components

  • ColorPicker: Enhance the new color picker design. (34598)
  • ColorPicker: Add reset timeout to ColorPicker’s copy functionality. (34601)
  • ToolsPanel: Refine component behaviour. (34530)
  • Resize Handles: Fix stroke width of resize handles. (34949)
  • ServerSideRender: Improve ServerSideRender Component to retain preview of the component while it is loading new state. (28289)
  • ServerSideRender: Delayed loading state of ServerSideRender component. (35033)

Global Styles

  • Add a simple Global Styles preview to the sidebar. (34991)
  • Update the Global Styles Icon and use it in the site editor’s panel. (34871)
  • Update the global styles sidebar to use a navigation component. (34885)

Widgets Editor

  • Widget Group: Make title directly editable. (34799)

Template Editor

  • Add edit template part menu button. (34679)

Themes

  • FSE: Add basic support for child themes. (34354)

New APIs

Block API

  • Introduce lock control at the block-type level. (32457)

Design Tools

  • InspectorControls: Wrap block support slots in ToolsPanel. (34157)

Accessibility

  • Improve file block accessibility by adding aria-describedby to download button. (28062)
  • Button Block: Add prefix to the description ID. (34900)
  • Snackbar: Fix focus loss on dismiss. (34736)

Performance

  • List View: Try disabling async mode provider around selected block in ListView. (34519)

Bug Fixes

Block Editor

  • Copy Handler: Only handle paste event once. (34430)
  • Fix save-state indicator appearance. (34947)
  • MediaReplaceFlow: Avoid React warning when selecting media. (34618)
  • Remove .has-link-color class upon clearing the link color. (34700)
  • Rich Text: Fix arrow navigation with consecutive formats. (35014)
  • Rich Text: Also strip object replacement character when removing padding. (34851)
  • Writing flow: Fix focus trap on non-text input types. (32714)
  • Fix bug in the receiveBlocks action resulting in a broken block list. (35076)

Block Library

  • HTML block: Prevent external styling of editing UI. (34727)
  • Page List Block: Fix gap in vertical page list. (35026)
  • MediaPlaceholder: Fix media library button opening the file upload modal. (34894)
  • QueryPagination: Fix layout support. (34897)
  • Query Pagination: Fix center alignment. (34739)
  • Group block: Lower CSS specificity of padding declaration. (34854)

Global Styles

  • Cache global stylesheet keyed by theme. (34704)
  • Clean theme data when switching themes in the customizer. (34540)
  • Fix dimensions panel default controls display. (34828)
  • Fix for link color in containers. (34689)

Components

  • Fix Dropdown/DropdownMenu toggle closing in all UAs. (31170)
  • Font Appearance Control: Fix selectedItem downshift uncontrolled prop warning. (34721)
  • ToolsPanel: Allow SlotFill injection of panel items. (34632)
  • ToolsPanel: Remove / re-register panel items if the panelId changes. (34726)
  • ToogleGroupControl: Fix update when unmounted. (34756)
  • Unit Control: Always display current unit value if valid. (34768)

Template Editor

  • Fixes left & right floats for blocks that are direct children of .wp-site-blocks. (34635)
  • Fix new template form onSubmit logic. (34988)

REST API

  • Add missing field _invalid in menu item REST API. (34670)
  • Fix ‘menu_exists’ response status code. (34888)
  • Remove parent and position validation from menu item REST API endpoint. (34672)
  • Filters are incorrectly applied in the __experimental/menu-items controller. (34857)
  • Fix the parent menu item field in REST API responses. (34835)

Themes

  • Fix block gap added to the block templates skip link. (34986)

Widgets Editor

  • Fix disabled blocks logical error on Widgets screen. (34634)
  • Prevent welcome guide overflow x scroll. (34713)

Experiments

Navigation Block

  • Add a Submenu block for use in Navigation. (33775)
  • Initialize responsive modals with window onload event. (34544)
  • Enable open on click for Page List inside Navigation. (34675)
  • Hide theme-provided underlines when menu item is in setup state. (34486)
  • Only capture toolbars on the parent Navigation block when not in vertical mode. (34615)
  • Polish wavy underline. (34954)

Navigation Editor

  • Add initial navigation editor user documentation. (34985)
  • Adjust header toolbar icon styles. (34833)
  • Consolidate menu name and switcher. (34786)
  • Update Navigation Editor to support new submenu block. (34281)
  • Use response messages returned from API for notices. (34903)
  • Add global inserter to Navigation Editor. (34619)
  • Save menu items using the REST API. (34541)
  • Add space between menu name and switcher button. (34960)
  • Keep Navigation Editor snackbar from overflowing notices. (34661)
  • Navigation Editor: Avoid crash when transforming navigation link. (34980)
  • Correctly display notices. (34852)
  • Display error notice inside modal. (34884)
  • Fix navigation editor missing appender not showing appender when no blocks selected. (34678)
  • Fix navigation editor undo button being active when editor loads. (34839)
  • Open link control if submenu parent is link. (34798)
  • Stop submitting Create Menu form in busy state. (34983)
  • Fix saving locations using the “Manage Locations” popup. (34714)

Site Editor

  • Site Editor – add basic plugin support. (34460)

Documentation

Handbook

  • Minor copy improvements. (35015)
  • Update versions to include 5.8.1. (34789)
  • Fix typography.customLineHeight value in the compatibility table. (34791)

Packages

  • Update the note about using polyfill for ES2015+ features. (34878)
  • Components
    • Add Compound Components section to components CONTRIBUTING.md. (34697)
    • Dropdown: Tidy up documentation. (34861)
    • Fix small typo in the component’s CONTRIBUTING guidelines documentation. (34753)
    • ItemGroup: Add story showcasing more complex layouts. (34708)
    • Update wordpress/components package’s contributing guidelines. (33960)
    • Update AlignmentMatrixControl documentation post merge. (34662)
    • Update components CONTRIBUTING.md structure. (34877)
    • Update documentation for ClipboardButton component. (34711)
  • Create Block: Remove wp-cli callout since not recommended and outdated. (34821)
  • Navigation Editor:
    • Fix inconsistencies and errors. (34682)
    • Update the Hooks section in documentation. (35035)
  • Scripts: Add CHANGELOG entry for jest-dev-server upgrade. (34657)

Other

  • Update overall plugin description. (34850)

Code Quality

  • Add tests for slug to class/css variable conversion. (34787)
  • Refactor the core-data store to thunks. (28389)
  • Remove some low impact APIs that were deprecated on WP 5.3. (34537)
  • Rewrite FocusableIframe as hook API. (26753)
  • Rich text: Only merge neighbouring equal formats when applying a format. (35016)
  • Writing Flow: Merge place caret at edge functions. (30481)
  • Site editor: fix PHP notice: Undefined index: __unstableType. (34735)
  • Use rest_is_field_included function in menu endpoints. (34673)
  • Remove duplicate Theme JSON block gap key. (34774)

Block Editor

  • Global shortcuts: Use React events (portal bubbles & contextual). (34539)
  • Rename experimental prop used in BlockControls. (34644)
  • Update callers to handle when getBlockType returns undefined. (34891)

Block Library

  • Latest Comments: Add missing parameter to widget_comments_args. (29403)
  • Navigation submenu block: Replace global shortcut event handlers with local ones. (34812)

Components

  • ColorPicker: Replace global shortcut event handlers with local ones. (34508)
  • Delete the createComponent utility function. (34929)
  • Refactor away from the createComponent function: CardMedia (34915), ControlLabel (34927), Elevation (34916), FlexBlock (34917), FlexItem (34918), Grid (34919), HStack (34920), Heading (34921), Scrollable (34922), Spacer (34923), Surface (34924), Text (34925), Truncate (34926), VStack (34928).
  • Remove all dashicon usages from Storybook stories. (33984)
  • Mark ControlLabel, FormGroupLabel and FormGroupContent as non-polymorphic. (34966)

Global Styles

  • Fix Global Styles double border. (34906)
  • Rename globalStyles to styles. (34946)

i18n

  • Add a “translators:” comment in the core class used to implement a Block widget. (34840)

Tools

Testing

  • Add editor onboarding tests. (34431)
  • Fix flaky navigation editor test by waiting for required elements. (34767)
  • Fix native Latest Posts end-to-end device tests. (34715)
  • Iframed editor: Add jQuery integration end-to-end test. (33007)
  • Navigation Editor: Migrate from response mocking to rest api util. (34869)
  • Navigation Editor: Fix failing end-to-end test. (34874)
  • Navigation Editor: Add end-to-end tests for global inserter to the Navigation Editor screen. (34804)
  • Navigation Editor: Update new navigation editor test to use REST API to create a menu instead of response mocking. (35025)
  • Try reporting flaky tests to issues. (34432)
  • Try to fix flaky iframe test. (34776)
  • Test that add_theme_supports are loaded for themes without theme.json. (34998)

Build Tooling

  • Fix package lock inconsistencies. (34790)
  • Update caniuse package to the latest version. (34685)
  • VSCode integration: Update var ${workspaceRoot} to ${workspaceFolder}. (34269)
    • Replace usages of workspaceRoot with workspaceFolder. (34887)
  • Bump jest-dev-server to v5. (34560)
  • ESLint Plugin: Update eslint jsdoc dependency. (34338)
  • Storybook: Remove G2 prefix from the Components section. (34734)
  • Block Editor: Update react-spring to 9.2.4. (30979)
  • Move react-native-url-polyfill to dev dependencies. (34687)
  • Use Jest related rules only when the package is installed. (33120)
  • Ensure that all *.asset.php files are included in plugin.zip. (34875)

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.

VersionLoading TimeKeyPress Event (typing)
Gutenberg 11.67.6 s38.38 ms
Gutenberg 11.57.2 s38.54 ms
WordPress 5.87.9 s45.97 ms

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

Thanks to @priethor, @mcsf, @matveb, and @jameskoster for helping with the release!

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

This is great, I see the ability to lock blocks in particular as a game changer!

Under “Performance Benchmark” do the Gutenberg versions need to be edited from `10.x` to `11.x` or are the most current metrics from Gutenberg `10.x`?

need to be edited from `10.x` to `11.x`

Indeed! Sorry about that 🙂 – I updated them.

Toolbar component update: September 2021

19 tickets closed during the 5.8 cycle, and some of the remaining bugs are already in the 5.9 milestone.

So what else should happen soon? To help set priorities for upcoming releases, please check out the groups of open tickets below. Hopefully you’ll find a ticket that interests you.

Content and arrangement

The first two tickets here suggest a long-term direction for the toolbar content and the order of links.

These four are potential short-term enhancements.

Showing the right elements in the right context

Interactivity

One major proposal is replacing the hover interaction for expanding dropdown menus so that would require intentional clicking (or touchscreen tap, Space or Enter key) with JavaScript enabled. A change this big needs plenty of testing early in a release cycle, and the code is not ready for that yet.

Ultimately, a good implementation of this could keep users from accidentally opening the profile dropdown when they navigate near the Publish button. And it could fix up to three reported bugs:

Two tickets address long dropdown menus:

Other potential fixes and improvements can help the user experience.

CSS-focused changes

The first three CSS tickets below are bugs.

These three are enhancements.

Developer-focused features

Options/preferences

Props to @marybaum for reviewing and editing this post, plus @sergeybiryukov for reviewing it.

#toolbar

In My Sites you should avoid using switch_to_blog(), it’s extremely slow when you have many sites. That’s why I made http://wayback.fauppsala.se:80/wayback/20211007172233/https://github.com/soderlind/super-admin-all-sites-menu

I also removed window.hoverintent, it’s slow when you have many sites, I use addEventListener in capturing mode instead.

I will try this plugin soon on my 150+ multisite @pers! Thank you very much for this. 👍

Editor Chat Summary: 29th September 2021

This post summarises the weekly editor chat meeting (agenda here) held on Wednesday, September 29, 2021 at 02:00 PM UTC in Slack. Moderated by @get_dave.

Gutenberg Plugin releases

WordPress 5.9 “Go, no go” date and priorities

  • The “go, no go” review date for WordPress 5.9 is coming up on October 12, 2021.
  • Gutenberg 11.6.0 was the final full release of the Gutenberg Plugin prior to that date (although we’ll have an RC for 11.7.0 on the 6th October which can be used for the “go/no go”).
  • The main goal for 5.9 is getting full site editing to all WordPress users.
  • The key “candidate” features are listed in the suggested roadmap.

Updates based on the scope for Site Editing projects

Updates were requested for the key projects:

Global Styles

@youknowriad provided an async update on the agenda:

  • We’re making some good practice hoping to be in a good shape for 5.9.
  • We’ve been iterating on the designs proposed in this overview issue.
  • We’ve landed the drill down Navigation in the sidebar and we are iterating on the different panels and components. (you can follow the updates on the issue)

Also related to this, @mciampini provided an update from the folks working on the components package:

Shipping:

In Progress:

  • We’re now moving to use the NavigatorProvider components in other contexts in Gutenberg, including the preferences modal.
  • This will help us to validate the API of the component and reduce overlap with the existing Navigation components that specifically render the “W” sidebar in the full site editor.

Template Editor

No one was available to provide an update. I asked around and @kevin940726 let me know of progress on the Template Part Focus Mode:

  • Merged #34679 to add the “Edit template part” button in ellipsis menu.
  • Merged #34732 to add the back button in the focus mode (isolated template part mode)
  • Rob is working on #35170 to show the ellipsis menu in the list view
  • I just merged #35202 and opened #35239 to add template areas to top bar and the inspector

Patterns

No one was around at the time of the meeting, but having asked around, @ntsekouras provided an update for us:

Navigation Editor

@get_dave provided the update:

Would particular like to highlight the need to provide feedback on the ongoing discussion regarding the proposal to utilise a dedicated classic Menu block in the Editor.

Navigation Block

@joen provided the update:

Block based Widgets Editor

No one was around to provide an update but one improvement I’m aware of is that you can now edit the title of the Widget Group block directly.

Seems like a small change but it really helps improve the flow of a block which is critical for solid backwards compatibility.

Native Mobile Team

@antonisme provided the update:

Shipped

  • Embed block improvements and fixes
  • Use tarball instead of git tag for react-native-editor forked dependencies
  • Added native version of Dashicon component for mobile

Fixes:

In Progress:

  • Launching soon a way to contact support from inside editor
  • Additional Embed block improvements
  • GSS Font size, line height, colors

Task Coordination

The following items were shared by folks to update us on what work is in progress or where help is needed:

@shaunandrews:

  • I’m working up a some designs around block controls (like height, width, border, background, etc) and their groupings (dimensions? shape? layout?).
  • Check out the #design channel for some more info. I hope to write up some thoughts this week.

@mamaduka:

  • Helping with PR reviews/testing.
  • Worked on a few small PRs of my own.
  • I’ve PR that should fix editor crash when dragging multiple blocks into innerBlocks. I’m not very familiar with this part of the code, and I would appreciate extra eyes on it.
  • Also started working on useSelect call optimizations because of missing dependencies across the codebase.

@annezazu:

@welcher:

@get_dave:

@mciampini:

  • I will continue refining the Navigator* components and the ItemGroup and Item components.
  • Helping with PR reviews around the @wordpress/components package.
  • Helping Riad with the updated Global Styles sidebar.

Open Floor

Adding locking capabilities to Reusable Blocks

  • @paaljoachim explained that at the moment it is too easy to make an accidental change to a Reusable block.
  • We soon should get a lock mechanism in place as per the overview Issue on locking.
  • @johnstonphilip queries whether locking is enough to ensure that the user understands the action they are taking is destructive across other pages.
  • @get_dave noted that the Update/Publish flow now separates out changes to the current Post vs Reusable Blocks (similar to how the Site Editor handles saving template parts).
  • @get_dave recommend raising an Issue to suggest having a more explicit warning inline on the Reusable Block to flag that you are making changes to a global entity.

Getting useInnerBlockProps and LinkControl out of “experimental” status

  • @fabiankaegy brought up two tickets related to features that are currently marked as __experimental which he thinks are at the point where they can be moved out of the experimental state.
  • @get_dave responded re: <LinkControl> to say:
    • There are still a number of items I’d like to see ticked off the tracking issue prior to merging (help with these appreciated).
    • It is quite powerful, but we should look at reducing the complexity of the component itself before committing to it.
    • Due to look at the architecture soon to see what improvements can be made – @youknowriad has mentioned this in the past.
  • @get_dave noted that @ellatrix has a PR to stablise useInnerBlocksProps and that more reviews and input are needed to get this to land.
  • It was agreed that given how long the components have been around that we should look to standardise both.

Wrap up

Thanks to everyone who attended the meeting!

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

Dev chat summary – September 29, 2021

@audrasjb led the chat on this agenda. You can also read the Slack logs.

Highlighted blog posts

Bringing to your attention some interesting reads and some call for feedback and/or volunteers:

Worth mentioning:

Thanks to the 23 contributors of the past week, including 4 new contributors! Kudos to the 5 core committers of the week, too.

A Week in Core – September 27, 2021

Upcoming releases updates

Next minor release(s)

@desrosj and @circlecube are still leading the 5.8.x releases. They published a schedule for 5.8.2 and –if needed– 5.8.3.

The 5.8.x point releases are coordinated in the #5-8-release-leads Slack channel. This channel is public and will be archived once 5.9 is released.

@costdev pointed out that a patch for ticket #53801 leads to a change in both Core and in the @wordpress/widgets package and asked for advices for how to ensure that any changes are committed at the same time to minimise issues on either end. @audrasjb answered that there is already an issue for this ticket in the 5.8.2 Gutenberg project board.

Next major release

Concerning the next major release —WordPress 5.9— a planning roundup was published a couple weeks ago.

Worth noting that @chanthaboune proposed a review of the upcoming 5.9 key features in the last issue of the WordPress.org podcast.

@audrasjb ran a first bug scrub last week to review the tickets marked early. He will run another one on Thursday, October 3, 2019 at 08:00 PM UTC.

Reminder: everyone is welcome to run a bug scrub on the #core Slack channel. If you are interested, please read this handbook post: Leading bug scrubs and get in touch with @audrasjb or @francina for details.

Also, @audrasjb silently scrubbed the Future Release queue and moved a dozen of tickets (in various components) to 5.9, with refreshed patches when needed. Most of them are ready and waiting for review/commit.

Component maintainers updates

Build/Test Tools – @sergeybiryukov

PHPUnit 9.5.10 and 8.5.21 were released with a breaking change: PHP deprecations are no longer converted to exceptions by default (convertDeprecationsToExceptions="true" can be configured to enable this). See changeset [51871] and ticket #54183 for more details.

This is also included in the Changes to the WordPress Core PHP Test Suite dev note, which is highly recommended to read as it includes other important changes for plugin and theme authors using the WordPress Core test framework as a basis for their integration tests.

Upgrade/Install – @afragen

@afragen shared that there is currently a lot of activity on a 9 years old ticket: #22316. He added a new PR which is ready for review.

@audrasjb added that the design of the feature was discussed during the last #core-auto-updates weekly meeting.

@joyously asked if it is supposed to handle initial installation or deactivation and uninstall also? @audrasjb answered that it only handles initial installation, because a dependency could exists without the “base” plugin.

@joyously asked what value does this enhancement add to the existing implementation. @clorith answered that It surfaces which plugins would enhance (or enable) functionality, so yes it has value. @audrasjb added that it standardizes a process which currently has many different implementations.

@afragen encouraged testers to install the PR, add a test plugin with a couple of dot org plugin slugs in a comma separated list in the Required Plugins header. Removing or changing the header name will deactivate those dependencies from being displayed.

Toolbar – @sabernhardt

@sabernhardt shared a draft of a Toolbar component update post.

He also pointed out that a docs update (#54191) was just committed today.

Open Floor

From @marybaum and @annezazu: there is a new testing call in the Full Site Editing Outreach Program.

@costdev noted that the Administration component doesn’t have a maintainer currently listed. He asked for a review of #53152. @sergeybiryukov moved it to milestone 5.9.

@pbearne asked for a review of #54020. He’s available to make a simpler patch if needed.

@webcommsat shared that tomorrow (30 September) is the last day of #WPTranslationDay 2021. Everyone is welcome to come and join the polyglots team for the final event and the celebrations from 16:00 UTC.

#5-8-x, #5-9, #dev-chat, #summary

Dev Chat Agenda for Sept 29, 2021

Here is the agenda for this week’s developer meeting to occur at Wednesday, September 29, 2021 at 08:00 PM UTC.

Blog Post Highlights and announcements

Bringing to your attention some interesting reads and some call for feedback and/or volunteers:

Next releases status update

Components check-in and status updates

  • Check-in with each component for status updates.
  • Poll for components that need assistance.

Open Floor

Do you have something to propose for the agenda, or a specific item relevant to the usual agenda items above?

Please leave a comment, and say whether or not you’ll be in the chat, so the group can either give you the floor or bring up your topic for you accordingly.

This meeting happens in the #core channel. To join the meeting, you’ll need an account on the Making WordPress Slack.

#5-8-2, #5-9, #agenda, #core, #dev-chat

Editor chat summary: Wednesday, 22 September 2021

This post summarizes the weekly editor chat meeting on Wednesday, 22 September 2021, 14:00 UTC held in Slack.

What’s next in Gutenberg? (Mid-September 2021)

@jorgefilipecosta said the post with the goals for the Gutenberg project in September is published and referred that the priorities are the template Editor, Patterns, Global Styles theme.json, the design tools., and the Navigation block/navigation editor work.

As a follow-up @ntsekouras brought attention to an experiment to trigger some discussions – a Patterns explorer, asking people to share their thoughts.

Project Updates

Mobile Application

Shipped

  • Improve error handling for embed block
  • Improve Reusable Blocks inserter UI

Fixes

  • Fix image block height and border regression
  • Fix back icon color in dark mode

In Progress

  • Additional Embed block improvements
  • GSS Font size, line height, colors

Components package

Shipping

  • Completed a migration away from the createComponent function. This simplifies the process of adding new components to the library, using the more straightforward View component.
  • Following up on the recently expanded contributor guidelines, we simplified the structure of the guidelines and added a table of contents.

In Progress

  • @youknowriad merged a PR that introduces a navigation component to the Global Styles sidebar, which moves us closer to the updated designs. We’re experimenting now with a revised Navigator component that may provide greater flexibility for the design.

Navigation Editor

Lots of work happening on priority items. Thanks to everyone who is contributing so much work.

REST API interactions have been improved and more issues identified.
• Started looking at ways to add links in Bulk.
• Using Theme JSON to control the block in the editor has been ruled out.
• Another Hallway Hangout is on the cards – dates/times to be confirmed.

Task Coordination

@annezazu

Hallway hangout for adoption pathways for FSE with Marcus & Dave, continue amplifying the current block theme switching exploration (please check it out!), did some light triage, and shared a core editor improvement post on the new Widgets Group block!

@ntsekouras

  • Query Pagination with `flex` layout(#34876, #34897).
  • Pass the search value to inserter, when clicking Browse All(#34912).
  • Delayed loading state of SSR component(#35033).
  • Pattern Explorer experiment(#35006).

@jorgefilipecosta

For the next week, the plan is to continue iterating on the design and address the remaining follow-ups we have thinks like changing the border of the input field from a gray to slightly different gray changing the dimension of inputs from 30px to 40px, changing the focus look on the range control.

@mciampini

Will keep supporting @jorgefilipecosta and other folks working on the @wordpress/components package, including most of the work that is being done on the new Global Styles sidebar.

Open floor

Responsiveness

Roman Axelrod asked the following:

It was mentioned earlier, but… At time moment, core editor doesn’t provide options of setting different styling rules for each device / breakpoint (Preview modes: Desktop, Tablet, Mobile).

Right now, the rules are global. For example if I set padding: 60px to Group block from the right sidebar of the editor, this rule is going to appear on Desktop and Mobile.I curious if we are going to have the same functionality that all popular page builders have? Usually they provide a list of breakpoints and ability to “overwrite” styling rules of previous breakpoint. It gives ability of adapting the design by requirements.Is this something that we can expect soon? Are we going to have something like this in 2021?

@jorgefilipecosta said he thinks that is not something on the roadmap for 5.9, but allowing to control how things look depending on the dimensions of the place where they are rendered is something that will end up existing.

Custom Fields

Roman Axelrod asked the following:

Are there any plans or ideas of using Custom Fields in core blocks?
For example, imagine the situation where I have 20 pages. All pages have a “Hero” section that contains titletextbutton on the left and image on the right.
The design is the same but the content is different and unique for each page (kind of a template).Now let’s say, after I built these 20 pages, we realized that the Heading block should be 5px bigger.
How should I fix that? It might be annoying to go page by page and update the font-size of each heading.As a reference, Elementor page builder provides this kind of option – they call it “Dynamic Content”.
I thought that the block-template-parts of FSE will solve this case. But this is still not there. Are there any thoughts/discussions about similar cases?

@jorgefilipecosta answered the following:

Hi Roman, maybe the solution to your issue is to define a CSS variable that represents the size. Theme.json provides a mechanism for declaring the css variables, and then instead of using 5px as value you use the css variable as the value. Changing the variable will then change the size in every place.

Roman followed up asking about how non-developers would be able to change those values. @jorgefilipecosta said that If one wants to allow a user to change a CSS variable, one could do it by registering a custom sidebar to change the variable. Maybe one day core offers something that automatically renders a UI where users could change variables registered using theme.json, but it is not part of the road map for now.

Developer Hours online

@bph made a big announcement during the core editor chat:

There will be a make core post with more info, this is just a heads-up, about a trial initiative to hold “Developer Hours online” every other week, with a group of Gutenberg developers, a short topic and then answering attendee’s Block and Theme building questions, with screen sharing of code and follow-up post. Depending how the trial goes, we might expand it. If you want to be part of that initiative let me know or comment on the post.

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

Implementing a Webfonts API in WordPress Core

Plugin and theme developers have been able to enqueue scripts and styles for years, but fonts have always been more complicated to enqueue. Following ticket #46370 and last September’s proposal to add a fonts enqueue API in WordPress Core, we now have a patch ready.

With the recent advancements in Gutenberg, global-styles, and an effort to consolidate options and UIs in the site-editor, a Webfonts API is becoming a necessity as it will allow theme developers to define fonts in their theme.json files.

In this first iteration, we are mirroring the scripts & styles enqueueing functions for consistency. Since enqueueing a webfont entails enqueuing a stylesheet (or adding inline styles) to enqueue the font files themselves, the webfonts API functions act as wrappers for the stylesheets API (with the appropriate modifications where needed).

The intention for this initial iteration is to provide a basis we can build upon and improve in the future – which is why it was kept minimal. More improvements and functionality will be added in the future, but in order to improve it, it has to be there.

The patch adds the following functions:

  • wp_register_webfont
  • wp_deregister_webfont
  • wp_enqueue_webfont
  • wp_dequeue_webfont
  • wp_webfont_is
  • wp_webfont_add_data

The syntax of all these functions is identical to their style counterparts, so wp_register_webfont is the same as wp_register_style and so on. The only difference is the use of $params in lieu of $deps for practical reasons.

Notes:

  • The styles registered for webfonts automatically get a webfont- prefix to avoid conflicts with any similarly named stylesheets. This provides a clear distinction between normal styles and webfonts styles, while keeping the implementation simple.
  • Since webfonts don’t have dependencies, the $deps argument was replaced with $params. These params can be used to register a webfont from local files, and auto-generate the CSS for @font-face.

Enqueuing a webfont from a remote URL

To use a webfonts API (Google Fonts, Adobe fonts, etc), we can use the URL provided by the API directly:

1
2
3
4
5
6
7
8
add_action( 'wp_enqueue_scripts', function() {
    wp_enqueue_webfont(
        // The handle
        'dancing-script',
        // URL to the webfont CSS - can use any public API.
        'http://wayback.fauppsala.se:80/wayback/20211007172233/https://fonts.googleapis.com/css2?family=Dancing+Script:wght@500;600&display=swap',
    );
} );

This is identical to what we would previously do using the wp_enqueue_style function, but now using a more appropriately named wp_enqueue_webfont function. With the example code above, the webfont will be enqueued and the stylesheet’s handle will be webfont-dancing-script.

Generating CSS for a webfont

It is possible to generate the CSS for a webfont using the provider parameter and the wp_webfont_generate_styles function.

A provider is an object with details about the provider’s implementation and a method to get (or generate) the CSS from that API.

Generating styles for bundled font files

To generate styles for bundled font-files, set the provider to new WP_Fonts_Provider_Local().

1
2
3
4
5
6
7
8
9
10
11
$my_font_styles = wp_webfont_generate_styles( array(
    'provider'     => new WP_Fonts_Provider_Local(),
    'font-family'  => 'My Font',
    'font-display' => 'swap',
    'font-style'   => 'normal',
    'font-weight'  => '400',
    'src'          => array(
        get_template_directory_uri() . '/fonts/font.woff2',
        get_template_directory_uri() . '/fonts/font.woff',
    ),
) );

Generating styles for Google fonts

To generate styles for a Google font, set the provider to new WP_Fonts_Provider_Google.

1
2
3
4
5
$roboto_styles = wp_webfont_generate_styles( array(
    'provider'    => new WP_Fonts_Provider_Google(),
    'font-family' => 'Roboto',
    'font-weight' => '400',
) );

Using the generated styles

You can attach the styles to an existing stylesheet using wp_add_inline_style:

1
2
3
4
5
6
7
8
9
10
11
12
add_action( 'wp_enqueue_scripts', function() {
    // Enqueue theme stylesheet.
    wp_enqueue_style( 'my-theme-styles', get_theme_file_uri( 'style.css' ) );
    // Get webfont styles.
    $roboto_styles = wp_webfont_generate_styles( array(
        'provider'    => new WP_Fonts_Provider_Local(),
        'font-family' => 'Roboto',
        'font-weight' => '400',
    ) );
    // Add webfont styles.
    wp_add_inline_style( 'my-theme-styles', $roboto_styles );
} );

Alternatively, you can use the wp_enqueue_webfont function:

1
2
3
4
5
6
7
add_action( 'wp_enqueue_scripts', function() {
    wp_enqueue_webfont( 'roboto-400', '', array(
        'provider'    => new WP_Fonts_Provider_Local(),
        'font-family' => 'Roboto',
        'font-weight' => '400',
    ) );
} );

This will internally call wp_enqueue_style with a blank $src, and attach the webfoot styles to the defined $handle.

Adding implementations for more 3rd-party APIs

At the moment of this writing, Google-Fonts is the most popular API for web fonts, and the only one publicly available, free, with OpenSource-compatible fonts.

Adding implementations for more APIs in the future can be done by extending the WP_Fonts_Provider class.

The $params argument

The $params argument is formatted as an array and accepts all valid CSS props of @font-face as its array keys. Any extra args are ignored. The list of valid descriptors was taken from MDN.
Defining a font-family is mandatory, and skipping that results in no CSS getting generated.

The src

If we’re enqueueing a webfoot from bundled files, then we can use the src to define the files. If we only want to define a single file for the webfont, then we can add it as a string ('src' => $url).
If we have multiple files for the webfont (different formats to support older browsers), then we can use an array ('src' => [ $url1, $url2 ]). In this case, the URLs get internally reordered for browser support (woff2, woff, ttf, eot, otf). SVG for webfonts is not supported because they have been deprecated (see caniuse.com/svg-fonts), so if provided it gets removed (like any other invalid type).

Note: The src can also accept data-urls.

Variable fonts

The font-variation-settings property accepts either a string (normal), or an array of key/value pairs (e.g. ["wght" => 637, "wdth" => 100]) and returns a string of these values (e.g., wght 637, wdth 100).

Props @jonoaldersonwp, @sergeybiryukov for reviewing

What a great feature! Does it go to WordPrees 5.9?

We’re hoping it does. The patch still needs to be reviewed and merged, so if that happens soon, then it will be part of WP5.9 🙂

It is not mentioned anywhere in the post, but it sounds like when registering a webfont from Google Fonts there is something happening so that one doesn’t have to manually pass params like `font-weight` . Is that correct?

Also, I recall that you added some caching in your original PR by downloading font stylesheets to the server. Sounds like you removed this again? If not, it should really be mentioned in this post.

Preloading webfonts is enabled by default.

Have you done any measuring to ensure that this does not negatively impact performance? For example through tools like Lighthouse, PageSpeed Insights, and metrics like Core Web Vitals.

it sounds like when registering a webfont from Google Fonts there is something happening so that one doesn’t have to manually pass params like `font-weight` . Is that correct?

Yes, that is correct.
There are 2 ways to load webfonts:
1. Using a 3rd-party API like google-fonts
2. Using bundled font-files

If using a 3rd-party API, then all we have is the CSS file and that CSS is just enqueued verbatim. So any additional $params don’t have any effect, the styles provided by the API are all we need. If the user wants to change the font-weight etc, then they’d need a different URL from the API.
The $params are only really useful when enqueing bundled fonts.
Also worth noting is that since when using a 3rd-party API we only have access to the CSS URL and not the font-files themselves, it’s impossible to preload google-fonts, adobe-fonts etc. We don’t have access to the font-files URLs so they can’t be preloaded.

Also, I recall that you added some caching in your original PR by downloading font stylesheets to the server. Sounds like you removed this again? If not, it should really be mentioned in this post.

Yes, that part was removed. We wanted to keep this initial implementation as minimal as possible. All caching etc was removed and this patch is as simple as it could get. We can explore additional caching etc once we get an initial implementation in core 👍

Have you done any measuring to ensure that this does not negatively impact performance? For example through tools like Lighthouse, PageSpeed Insights, and metrics like Core Web Vitals.

Tests were done using a single webfont – in which case preloading it prevents FOUC and improved performance. Of course, if users start enqueing 10 webfonts and use 2 of those then performance will suffer, but that’s a case of doing-it-wrong and the same applies if enqueing 10 stylesheets and only use 1.
The implementation followed the results of discussions in #46370, but we can definitely switch the default value of preload from true to false if we find that’s a better approach.

Update: Changed the default value of preload to false and updated the post to reflect that change.

Follow-up question on the 3P API web fonts: I assume these web font CSS URLs are right now requested individually based on how they are enqueued?

I’m wondering whether it would be beneficial to combine them. For example, if three plugins enqueue their individual fonts via http://wayback.fauppsala.se:80/wayback/20211007172233/https://fonts.googleapis.com/css2, combine the query parameters and and only issue one request for all of them. We should probably test the performance impact of (not) doing that, but it is likely even more beneficial to combine the requests if some fonts are the same.

At a more foundational level, this makes me wonder whether we should really treat enqueuing individual font files and enqueuing API-based font CSS files (which may actually be a couple of fonts in one) via the same API – that feels somewhat problematic and counterintuitive. I’d envision something more like having a wp_register_webfont_provider (core could potentially support a couple popular ones by default, but at least it could provide the API), and then wp_enqueue_webfont could support a provider argument (API-based font) as an alternative to src (bundled font).

This is a really interesting exploration.

I love the idea of combining requests; I think there’s an opportunity to do some clever stuff in V2 (or, as a separate/additional process) where we analyse which fonts have been enqueued, and apply some filtering based on the provider(s) (and other factors).

In [this recent article on web.dev](http://wayback.fauppsala.se:80/wayback/20211007172233/https://web.dev/font-best-practices/) it’s advised to inline @font-face declarations instead of using a preload link, and to use a preconnect link in case of external requests.

`@font-face` declarations are inlined, but the font-files themselves are pre-loaded to avoid FOUC (http://wayback.fauppsala.se:80/wayback/20211007172233/https://web.dev/codelab-preload-web-fonts/)

It seems that the best practices have changed a bit.

Generally speaking, using the preload resource hint to load fonts should be avoided. Although preload is highly effective at making fonts discoverable early in the page load process, this comes at the cost of taking away browser resources from the loading of other resources

http://wayback.fauppsala.se:80/wayback/20211007172233/https://web.dev/font-best-practices/

preloading is beneficial when used properly.
However, you are correct. It can be damaging if improperly used… With that in mind, I changed the default value of preload to false and updated the post to reflect that change.

Thank you for the feedback and suggestions!

This is really an amazing feature, especially having the ability to preload the fonts so easily. But in the above doc it hasn’t been mentioned how to add the font via `theme.json` file despite it being mentioned at the beginning ar the article.

But in the above doc it hasn’t been mentioned how to add the font via `theme.json` file despite it being mentioned at the beginning ar the article.

Right now it’s not possible to add a webfont using theme.json.
First the patch needs to be reviewed and merged in WordPress. Once that happens, we can submit a pull-request in Gutenberg to allow enqueing a webfont from theme.json.
It’s something we need, but is not possible unless we have a webfonts API in WordPress-Core.

This looks really good. Thank you.

Great to see! Question: Why include “webfont” in the API instead of just “font”? Isn’t the fact that it’s being used in WP an indication that the font is already webby? (Not a big deal anyway.)

Definitely not a big deal, but I’d +1 this.

I think “webfont” more clearly excludes “system font(s)”, thus it’s worth keeping.

But system fonts aren’t ever enqueued, I think with system in the name it’s relatively clear they aren’t custom.

Again, while webfont doesn’t inherently exclude icon fonts, it’s most often used to refer to type glyphs. Icon fonts may no longer be best practice for vector glyphs, but they’ve hardly died out either.

I think font is generally more conscience and more broadly encompasses the icon font use case. It’s not a huge deal, I don’t feel super strongly about it but this seems the time to discuss the nomenclature.

When I hear the word “font”, my mind goes to the font-files.
When I hear the word “webfont”, in my mind it encompasses a lot more than just the font-files themselves.
Perhaps that’s just in my head, but to me, if a “font” includes CSS, it stops being a font and it becomes a webfont.
I know that the word webfont doesn’t have a clear definition (yet), but since this implementation generates the CSS which then adds the actual font files, using webfont as the name of the functions seemed more appropriate.
The functions don’t enqueue font-files, they generate (or enqueue) the styles for font-files, making them a webfonts implementation.

Yep, thank you for explaining your thinking.

Semi-related is while “webfont” seems to be the largely accepted proper noun (and what I agree should be what we adopt), there’s also “web font” seen in a number of places — both are on this MDN docs page and popular industry sites like CSS Tricks 😬.

I didn’t found any tests to understand what this API is printing in the page itself.

After reading all the feedback here as well as the ticket on trac,, the implementation was slightly refactored:

  • Introduced provider. This allows using $params to define a webfont from Google-Fonts or any other API in the future.
  • Added providers for Bundled fonts (WP_Fonts_Provider_Local) as well as Google Fonts ( WP_Fonts_Provider_Google).
  • Removed preload
  • Added support for preconnect for 3rd-party APIs
  • Added wp_webfont_generate_styles function. This created a separation and now the wp_enqueue_webfont function is more consistent with other wp_enqueue_* functions.

The post was updated with the new information and implementation.

s
search
c
compose new post
r
reply
e
edit
t
go to top
j
go to the next post or comment
k
go to the previous post or comment
o
toggle comment visibility
esc
cancel edit post or comment
0
:)