Unblocking WP6.5 – Font Library and Synced Pattern Overrides

A number of contributors have flagged a stalemate on a couple of different topics for WP6.5 this week. I want to first thank everyone who joined in the discussions on GithubGitHub GitHub is a website that offers online implementation of git repositories that can easily be shared, copied and modified by other developers. Public repositories are free to host, private repositories require a paid subscription. GitHub introduced the concept of the ‘pull request’ where code changes done in branches by contributors can be reviewed and discussed before being merged be the repository owner. https://github.com/, SlackSlack Slack is a Collaborative Group Chat Platform https://slack.com/. The WordPress community has its own Slack Channel at https://make.wordpress.org/chat/., and elsewhere. There were a lot of well-reasoned and important concerns raised and it was an excellent example of the way open sourceOpen Source Open Source denotes software for which the original source code is made freely available and may be redistributed and modified. Open Source **must be** delivered via a licensing model, see GPL. works in the open. Over the last few days, I’ve discussed the suggested approaches with several coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. and core-editor contributors, including pros, cons, and side effects. We’ve reached a consensus on a path forward on both the Font Library and the issue with Synced Pattern Overrides.

Font Library

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

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

  • The Font Library will use wp-content/fonts as the default storage folder. While locating fonts at the same level as themes and plugins gives fonts a lot of prominence, it’s worth noting blockBlock Block is the abstract term used to describe units of markup that, composed together, form the content or layout of a webpage using the WordPress editor. The idea combines concepts of what in the past may have achieved with shortcodes, custom HTML, and embed discovery into a single consistent API and user experience. themes are heading toward composability, allowing users to change collections of fonts, patterns, templates, and color schemes without switching the full theme. Storing fonts at the same level as themes is the first step to breaking down themes in these composable pieces and establishing new first-class concepts and objects within our software.
  • For installations that don’t support modification of the wp-content directory, the Font Library will use wp-content/uploads/fonts as a fallback location, ensuring we stay true to our project philosophy of designing for the majority while still making the feature available to anyone out of the box without extra steps from the user. 
  • The wp_get_font_dir() (source) is available to return the location of the site’s fonts folder. Extenders should use this function as it will allow them to seamlessly integrate with the Font Library regardless of their installed version of WordPress. This allows WordPress to manage the preferred directory location and any factors related to migrating folder locations (e.g., consolidating any remaining installations using wp-content/uploads/fonts to use wp-content/fonts) in future versions without extenders also needing to make changes.
  • For very edge cases, a font_dir filterFilter Filters are one of the two types of Hooks https://codex.wordpress.org/Plugin_API/Hooks. They provide a way for functions to modify data of other functions. They are the counterpart to Actions. Unlike Actions, filters are meant to work in an isolated manner, and should never have side effects such as affecting global variables and output. (source) still allows overriding the font storage folder.
  • Like wp-content/uploads itself, the fonts directory will not adhere to wp_is_file_mod_allowed / DISALLOW_FILE_MODS to prevent font uploads.
  • The dev notedev note Each important change in WordPress Core is documented in a developers note, (usually called dev note). Good dev notes generally include a description of the change, the decision that led to this change, and a description of how developers are supposed to work with that change. Dev notes are published on Make/Core blog during the beta phase of WordPress release cycle. Publishing dev notes is particularly important when plugin/theme authors and WordPress developers need to be aware of those changes.In general, all dev notes are compiled into a Field Guide at the beginning of the release candidate phase. will reflect these changes upon publication.

The following is still to be explored after WP 6.5:

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

Synced Pattern Overrides

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

Let’s do it!

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

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

#6-5