Skip to content

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

@vcanales

Description

@vcanales

@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​

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions