[wp-trac] [WordPress Trac] #49037: Expose all theme supports in /themes endpoint

WordPress Trac noreply at wordpress.org
Tue Jan 21 15:50:08 UTC 2020


#49037: Expose all theme supports in /themes endpoint
----------------------------------------+-----------------------
 Reporter:  adamboro                    |       Owner:  (none)
     Type:  enhancement                 |      Status:  new
 Priority:  normal                      |   Milestone:  5.4
Component:  REST API                    |     Version:  5.0
 Severity:  normal                      |  Resolution:
 Keywords:  needs-patch good-first-bug  |     Focuses:  rest-api
----------------------------------------+-----------------------

Comment (by TimothyBlynJacobs):

 > Thinking this ticket over, I wonder if we should add an api to register
 theme supports.

 From my perspective, such an API would make a lot of sense. I think we
 should open a separate ticket for it and work with the Themes component on
 it.

 Thanks for working on these patches @apieschel! Going to take a more in-
 depth look later, but one thing that I saw in my initial review is that
 the schema format for the child properties is wrong. See the first part of
 my comment here: https://core.trac.wordpress.org/ticket/48798#comment:11

 Also, for `html5` instead of listing those as properties, they should be
 an enum. So


 {{{
 'items' => [
          'type'   => 'string',
          'enum' => array( 'search-form', 'comment-form', 'comment-list',
 'gallery', 'caption', 'script', 'style' ),
 ],
 }}}

 > All new unit tests are passing except test_theme_can_manage_title_tag().
 Can't figure out why this line:

 This may be because `add_theme_support` checks if `wp_loaded` has fired,
 and if so, prevents the theme support from being registered. In this case,
 it may be find to add the support manually to the `$_wp_theme_features`
 global.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/49037#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list