Skip to content

Fix manage fonts UI and backend when no settings are defined in theme.json#281

Merged
matiasbenedetto merged 1 commit intotrunkfrom
fix/no-fonts-defined-by-theme
Mar 20, 2023
Merged

Fix manage fonts UI and backend when no settings are defined in theme.json#281
matiasbenedetto merged 1 commit intotrunkfrom
fix/no-fonts-defined-by-theme

Conversation

@matiasbenedetto
Copy link
Copy Markdown
Contributor

What ?

Fix manage fonts functionality when the settings object is not defined by theme.json.

If the settings.typography.fontFamilies is not defined in theme.json the manage fonts UI fails to render and the PHP backend throws warnings.

With this PR we are fixing both the UI and the backend.

How to test

  • Remove entirely the settings key of your theme.json.
  • Check if the manage fonts screen is rendering ok
  • Add google or local fonts
  • Navigate the manage fonts screen and check is working as expected.

Fixes: https://wordpress.org/support/topic/found-an-error-2/

@matiasbenedetto matiasbenedetto added the bug Something isn't working label Mar 17, 2023
Copy link
Copy Markdown
Contributor

@jffng jffng left a comment

Choose a reason for hiding this comment

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

Works as advertised, thanks!

@matiasbenedetto matiasbenedetto merged commit 879a743 into trunk Mar 20, 2023
@matiasbenedetto matiasbenedetto deleted the fix/no-fonts-defined-by-theme branch March 20, 2023 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants