Opened 10 years ago
Last modified 7 years ago
#32642 new enhancement
Add supports argument to register_taxonomy
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | 4.3 |
Component: | Taxonomy | Keywords: | has-patch dev-feedback 2nd-opinion |
Focuses: | rest-api | Cc: |
Description
This patch adds the supports
argument to register_taxonomy()
. It allows custom taxonomies to opt out of having the slug and description fields.
I've had custom private taxonomies where the only field which would be set is "Name", so an enhancement like this would allow taxonomies be more lightweight for clients.
Attachments (3)
Change History (14)
This ticket was mentioned in Slack in #core-restapi by rmccue. View the logs.
10 years ago
#4
@
10 years ago
+1 for description
-1 for slug
The slug field could be less prominent, and hidden by default, for all taxonomies, like it is for posts. (Show the slug n existing terms, but press a button to edit it.)
It should also be possible to remove support for description on builtin taxonomies.
This ticket was mentioned in Slack in #core by boone. View the logs.
9 years ago
#6
@
9 years ago
- Keywords 2nd-opinion added
- Milestone changed from Awaiting Review to Future Release
@rmccue You tagged this ticket rest-api
, which suggests that in the context of the API, taxonomy supports
would mean something more than hiding pieces of the admin UI. Can you say more about this?
The idea of hiding bits of the UI via supports
seems OK to me, but if we're going to exploit a metaphor already in use by post types, we should make sure the functionality parallels that of post types as well - and I'm pretty sure that supports
does more than hide admin UI for post types.
#7
@
9 years ago
@boonebgorges Indeed. We use the post type supports
to automatically add/remove support for different parts of the response. For example, if the post type doesn't support title
, we remove the title from the response (and the schema changes to reflect this).
Note that it's still technically possible to have titles on posts that don't support title
, but you have to implement the UI and such yourself. Likewise, you can add it back to the API reasonably easily.
Our general assumption is that removing support for something indicates you're doing something special with it, and probably want a different output format for it. supports
therefore is more of general indication of "I want WP to handle this".
Remove testing code.