[wp-trac] [WordPress Trac] #63253: Theme REST API: expose "has_theme_json" field
WordPress Trac
noreply at wordpress.org
Tue Apr 8 12:41:47 UTC 2025
#63253: Theme REST API: expose "has_theme_json" field
--------------------------+-----------------------------
Reporter: wildworks | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version:
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
Currently, there is no official way to detect whether the active theme has
`theme.json` or not via REST API.
We needed to check for the existence of theme.json to conditionally expose
Stylebook for the classic theme. As a temporary approach, we used the
`supportsLayout` setting, which is the equivalent of the
`wp_theme_has_theme_json()` function:
https://github.com/WordPress/gutenberg/blob/a4a5b07b4432d28ad4eb3646435bbaf9a8f9796e/packages
/edit-site/src/components/site-editor-routes/utils.js#L11-L12
However, there is no guarantee that this setting will remain equivalent to
`wp_theme_has_theme_json()` in the future.
We should expose the new "has_theme_json" field via the theme REST API.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63253>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list