[wp-trac] [WordPress Trac] #63299: WP_Theme: Add "has_theme_json" method

WordPress Trac noreply at wordpress.org
Thu Apr 17 04:27:23 UTC 2025


#63299: WP_Theme: Add "has_theme_json" method
-------------------------+-----------------------------
 Reporter:  wildworks    |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Themes       |    Version:
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 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.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63299>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list