Opened 7 months ago
Last modified 6 months ago
#63299 assigned enhancement
WP_Theme: Add "has_theme_json" method
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Themes | Keywords: | |
| Focuses: | Cc: |
Description
We plan to expose the has_theme_json field in the Theme Rest API in #63253. However, because the wp_theme_has_theme_json() function is based on the active theme, the has_theme_json field is not correct when fetching the theme collection with the following code, for example:
wp.data.select( 'core' ).getEntityRecords( 'root', 'theme', { per_page: -1, _fields: [ 'stylesheet', 'has_theme_json', 'is_block_theme' ] } );
To solve this, I think we need a has_theme_json() method, similar to the block_theme() method.
Change History (3)
This ticket was mentioned in PR #8705 on WordPress/wordpress-develop by @wildworks.
7 months ago
#3
Note: See
TracTickets for help on using
tickets.
Trac ticket: https://core.trac.wordpress.org/ticket/63299