-
Notifications
You must be signed in to change notification settings - Fork 4.8k
theme.json properties can't be overridden in PHP #33367
Copy link
Copy link
Closed
Labels
Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.jsonAnything related to the broader Global Styles efforts, including Styles Engine and theme.jsonNeeds Technical FeedbackNeeds testing from a developer perspective.Needs testing from a developer perspective.[Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.Questions or issues with incorporating or styling blocks in a theme.
Metadata
Metadata
Assignees
Labels
Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.jsonAnything related to the broader Global Styles efforts, including Styles Engine and theme.jsonNeeds Technical FeedbackNeeds testing from a developer perspective.Needs testing from a developer perspective.[Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.Questions or issues with incorporating or styling blocks in a theme.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Description
theme.jsonproperties cannot be (easily) overridden on the server-side due to the current implementation of filtering the block editor settings at a priority set toPHP_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
999which 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.