Opened 10 years ago
Closed 9 years ago
#31804 closed enhancement (maybelater)
Explicitly declare whether or not a post type supports attachments
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Posts, Post Types | Keywords: | |
Focuses: | Cc: |
Description
In WP-API, we'd like to add a link to all attachments associated with a given Post, Page, or other post type. However, there's no way currently to determine whether a post type supports attachments. We should make this more explicit.
From https://github.com/WP-API/WP-API/pull/1026/files#r27358934
Change History (6)
#2
@
10 years ago
What else would that kind of specification entail? Turning off parts of core UI? Explicit checks before assigning the post_parent?
This is certainly something that needs to be fleshed out. At the very least, it could be an informational flag for WP-API — post_type_supports( 'attachment' )
. However, it's worthwhile to do some technical discovery on whether such a flag should have an impact on existing components and UI in WordPress.
I'm open to suggestions on how we could make the inference that a post type supports attachments if we want to punt on adding something to core, but I don't have any great ideas at the moment.
This ticket was mentioned in Slack in #core-restapi by rmccue. View the logs.
9 years ago
#5
@
9 years ago
- Milestone changed from Future Release to 4.5
- Owner set to danielbachhuber
- Status changed from new to assigned
#6
@
9 years ago
- Keywords needs-patch dev-feedback rest-api removed
- Milestone 4.5 deleted
- Resolution set to maybelater
- Status changed from assigned to closed
While the purist in me really wants an API for this relationship, pragmatically it doesn't have much value for the REST API. It's fine that all post types (except revisions and attachments) support uploading attachments.
What else would that kind of specification entail? Turning off parts of core UI? Explicit checks before assigning the
post_parent
? Why enforce this just for attachments, and/or does doing it just for attachments possibly affect other kinds of many-to-one relationships thepost_parent
field enables?