Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow up: Concerns Regarding WP_Fonts_Resolver::get_settings() #56044

Open
vcanales opened this issue Nov 10, 2023 · 0 comments
Open

Follow up: Concerns Regarding WP_Fonts_Resolver::get_settings() #56044

vcanales opened this issue Nov 10, 2023 · 0 comments
Labels
[Feature] Typography Font and typography-related issues and PRs [Type] Enhancement A suggestion for improvement.

Comments

@vcanales
Copy link
Member

@azzaozz raised several concerns in the discussion of PR #55981 about the handling of $settings['typography']['fontFamilies']['theme'] in the WP_Fonts_Resolver::get_settings()function. Key points include:

  • Optimization Suggestion: Suggests moving a piece of code outside the loop for optimization, as $settings does not change within the loop​.

  • Uncertainty about Default Values: the expected default value and type for $settings['typography']['fontFamilies']['theme'] and $variation['settings']['typography']['fontFamilies']['theme'] are unclear. There is a concern that setting these to empty arrays might lead to an unexpected final value of $settings['typography']['fontFamilies']['theme'] being an empty array​.

  • Code Inconsistency: potential bugs and inconsistencies in get_settings(). The code checks $variation['settings']['typography']['fontFamilies'] but expects to use/merge $variation['settings']['typography']['fontFamilies']['theme']. Suggests that it might be more logical to check if theme is empty, which would also simplify the subsequent code​

@vcanales vcanales added the [Type] Enhancement A suggestion for improvement. label Nov 10, 2023
@jordesign jordesign added the [Feature] Typography Font and typography-related issues and PRs label Nov 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Typography Font and typography-related issues and PRs [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

2 participants