Skip to content

Font Library: changing the upload directory to wp-content/fonts - #54122

Merged
matiasbenedetto merged 5 commits into
trunkfrom
try/set-upload-dir
Sep 1, 2023
Merged

matiasbenedetto merged 5 commits into
trunkfrom
try/set-upload-dir

Conversation

@jffng

@jffng jffng commented Sep 1, 2023 •

Copy link
Copy Markdown
Contributor

What?

Fixes #53965, simplified alternative to #54076 as suggested by @matiasbenedetto .

Why?

We want the fonts to be stored in wp-content/fonts instead of wp-content/uploads/fonts.

How?

Changes the set_upload_dir and get_fonts_dir functions.

Testing Instructions

  1. Run the unit tests locally (npm run test:unit:php)
  2. Test manually in your console by following these instructions: Fonts Library: change upload directory to wp-content/fonts #54076 (comment)

Screenshots or screencast

@jffng jffng added the [Type] Task Issues or PRs that have been broken down into an individual action to take label Sep 1, 2023
@github-actions

github-actions Bot commented Sep 1, 2023 •

Copy link
Copy Markdown

This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress.

If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged.

If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack.

Thank you! ❤️

View changed files
❔ lib/experimental/fonts/font-library/class-wp-font-library.php
❔ phpunit/tests/fonts/font-library/wpFontFamily/base.php
❔ phpunit/tests/fonts/font-library/wpFontFamily/install.php
❔ phpunit/tests/fonts/font-library/wpFontFamily/uninstall.php
❔ phpunit/tests/fonts/font-library/wpFontLibrary/getFontsDir.php
❔ phpunit/tests/fonts/font-library/wpFontLibrary/setUploadDir.php
❔ phpunit/tests/fonts/font-library/wpRestFontLibraryController/installFonts.php

@jffng
jffng marked this pull request as ready for review September 1, 2023 19:19
@jffng
jffng requested a review from spacedmonkey as a code owner September 1, 2023 19:19
@jffng jffng changed the title Font Library: try changing the upload directory Font Library: changing the upload directory to wp-content/fonts Sep 1, 2023
@github-actions

github-actions Bot commented Sep 1, 2023

Copy link
Copy Markdown

Flaky tests detected in 538d030.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6053126918
📝 Reported issues:

@matiasbenedetto matiasbenedetto left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a small change regarding avoiding one hardcoded variable in the tests base class.

Apart from that it tests and works as expected. LGTM
Thanks for working on this 🚀

@matiasbenedetto
matiasbenedetto enabled auto-merge (squash) September 1, 2023 20:02
@matiasbenedetto
matiasbenedetto merged commit ac32ed5 into trunk Sep 1, 2023
@matiasbenedetto
matiasbenedetto deleted the try/set-upload-dir branch September 1, 2023 20:36
@github-actions github-actions Bot added this to the Gutenberg 16.7 milestone Sep 1, 2023
@mikachan mikachan added the Needs PHP backport Needs PHP backport to Core label Sep 6, 2023
@mikachan mikachan added [Feature] Typography Font and typography-related issues and PRs [Type] Enhancement A suggestion for improvement. and removed [Type] Task Issues or PRs that have been broken down into an individual action to take labels Sep 20, 2023
@youknowriad youknowriad added Backported to WP Core Pull request that has been successfully merged into WP Core and removed Needs PHP backport Needs PHP backport to Core labels Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backported to WP Core Pull request that has been successfully merged into WP Core [Feature] Typography Font and typography-related issues and PRs [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Font Library: use /wp-content/fonts instead of /wp-content/uploads/fonts to store font assets.

4 participants