Skip to content

theme.json properties can't be overridden in PHP #33367

@chrisvanpatten

Description

@chrisvanpatten

Description

theme.json properties cannot be (easily) overridden on the server-side due to the current implementation of filtering the block editor settings at a priority set to PHP_INT_MAX.

Being able to filter theme.json from PHP is a valuable way to ease the on-ramp to theme.json adoption; for example if a theme includes an existing settings panel for configuring colors and fonts, they may be able to use PHP to insert this configuration into the theme.json file until a global style editor is available to client users.

I would propose updating the filter to hook in at 999 which still conveys that the filter is intended to be run late while still allowing developers the option to adjust without a more complex unhook/rehook dance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.jsonNeeds Technical FeedbackNeeds testing from a developer perspective.[Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions