[wp-trac] [WordPress Trac] #49406: Introduce register_theme_support method
WordPress Trac
noreply at wordpress.org
Tue Feb 11 15:08:54 UTC 2020
#49406: Introduce register_theme_support method
-------------------------+-----------------------------
Reporter: kadamwhite | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Themes | Version: trunk
Severity: normal | Keywords:
Focuses: rest-api |
-------------------------+-----------------------------
In #49037 support was added to list support for core theme features in the
`/themes` endpoint. This patch was fairly conservative and manually
safelisted specific theme supports by manually enumerating their expected
schema in the controller.
Custom theme support values introduced by non-core plugins are not yet
supported due to the lack of a safe way to validate the shape and content
of their associated values. Several major plugins like
[https://docs.woocommerce.com/document/woocommerce-theme-developer-
handbook/#section-5 WooCommerce] and [https://jetpack.com/support
/infinite-scroll/ jetpack] do implement their own theme-support features.
While we can theoretically write out the schema for all high-profile
plugins manually, this approach is both inequitable (what is "high-
profile?") and would be unsustainably difficult to maintain.
The way that we're able to surface metadata to the API is by explicitly
registering it using `register_post_meta` (and related functions). In
#49037 therefore, @spacedmonkey
[https://core.trac.wordpress.org/timeline?from=2020-01-17T19%3A18%3A10Z&precision=second
proposed] introducing a new `register_theme_support` method which core &
third-party themes can use to describe the details of their features. This
method could be used by plugins to describe the theme features they
introduce, and the values used in that registration could then be used to
safely populate theme support details in this endpoint.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49406>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list