Skip to content

Commit

Permalink
Add fonts directory to file paths (WordPress#633)
Browse files Browse the repository at this point in the history
The Playground resolves URLs based on their path to determine whether to load
the resource at the URL or reroute it to its in-memory storage, such as for
themes and plugin content.

In WordPress 6.4, user-uploaded fonts will be stored in a new top-level uploads
directory and the Playground will need to support this. Otherwise, the Font
paths won't resolve properly and the Playground will return 404 errors for
them.
  • Loading branch information
ironprogrammer authored and dmsnell committed Sep 11, 2023
1 parent 6f39719 commit b58e396
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/playground/remote/src/lib/is-uploaded-file-path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export const isUploadedFilePath = (path: string) => {
path.startsWith('/wp-content/uploads/') ||
path.startsWith('/wp-content/plugins/') ||
path.startsWith('/wp-content/mu-plugins/') ||
path.startsWith('/wp-content/themes/')
path.startsWith('/wp-content/themes/') ||
path.startsWith('/wp-content/fonts/')
);
};

0 comments on commit b58e396

Please sign in to comment.