Make WordPress Core

Opened 12 years ago

Closed 11 years ago

#31804 closed enhancement (maybelater)

Explicitly declare whether or not a post type supports attachments

Reported by: danielbachhuber Owned by: danielbachhuber
Priority: normal Milestone:
Component: Posts, Post Types Version:
Severity: normal Keywords:
Cc: Focuses:

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)

#1 @helen
12 years ago

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 the post_parent field enables?

#2 @danielbachhuber
12 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.

#3 @rmccue
11 years ago

  • Keywords rest-api added; wp-api removed

This ticket was mentioned in ​Slack in #core-restapi by rmccue. ​View the logs.


11 years ago

#5 @danielbachhuber
11 years ago

  • Milestone Future Release → 4.5
  • Owner set to danielbachhuber
  • Status new → assigned

#6 @danielbachhuber
11 years ago

  • Keywords needs-patch dev-feedback rest-api removed
  • Milestone 4.5
  • Resolution → maybelater
  • Status assigned → 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.

Note: See TracTickets for help on using tickets.