Skip to content

Code quality check for theme.json related APIs #45171

@oandregal

Description

@oandregal

This issue tracks the current state of theme.json related APIs from a quality point of view, so we can bring up, discuss and address the issues.

WordPress 6.2: shipped

Public API:

Performance:

  • wp_theme_has_theme_json: cache output #45543
  • wp_get_global_settings: cache output #45372 #45971 #45969
  • wp_get_global_stylesheet: migrate from transient to object cache #45679
  • wp_get_global_styles_svg_filters : migrate from transient to object cache #47460 (done in core as the function was removed from Gutenberg)
  • While initially the cache was implemented as persistent across requests for the above methods, concerns were brought up to make it non-persistent and keep testing: #46150

Sync WordPress core <=> Gutenberg:

WordPress 6.3: shipped

Public API

WordPress 6.4: ongoing

Performance:

Public API

Next

Algorithm:

Public API:

  • Make sure all current uses cases of WP_Theme_JSON or WP_Theme_JSON_Resolver are covered by the addition of public methods.
  • Collocate customTemplates and templateAreas metadata with the actual data they represent (templates and template parts provided by the theme as HTML) and remove them from theme.json. #42732 In testing #38984 we ran into an issue with valid HTML comments that don't belong to a block #47212
  • Deprecate/Remove the wp_theme_json_get_style_nodes filter #45172 Filters, together with methods or the theme.json datum, are all part of the public API. We should aim to not expose private implementation details in the public API that prevent us from evolving it.
  • wp_get_global_styles: resolver the reference to the value #49715

Performance

Metadata

Metadata

Assignees

No one assigned

    Labels

    Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.jsonNeeds Dev NoteRequires a developer note for a major WordPress release cycle[Feature] Block APIAPI that allows to express the block paradigm.[Type] Code QualityIssues or PRs that relate to code quality[Type] Tracking IssueTactical breakdown of efforts across the codebase and/or tied to Overview issues.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions