Follow up: Concerns Regarding WP_Fonts_Resolver::get_settings() #56044
Labels
[Feature] Typography
Font and typography-related issues and PRs
[Type] Enhancement
A suggestion for improvement.
@azzaozz raised several concerns in the discussion of PR #55981 about the handling of
$settings['typography']['fontFamilies']['theme']
in theWP_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 codeThe text was updated successfully, but these errors were encountered: