Opened 13 months ago
#20547 new enhancement
Ability to define post attachment status on insertion
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Media | Version: | 3.4 |
| Severity: | normal | Keywords: | dev-feedback |
| Cc: |
Description
By default, wp_insert_attachment will either set a new attachment as 'inherited' or 'private' - inherited being that it simply mimics the post status of its parent.
This is fine by default, but what about when wanting to run tests? For example, you have a live post that you want to add attachments to, but you want to ensure that the attachments (whatever they may be) are properly formatted before making them appear on your live post. By default, just uploading the attachment will push it live because it has inherited the published status of its parent.
Is this doable? What about filtering $object in the wp_parse_args function inside wp_insert_attachment to allow that property (along with the others - it makes sense to be able to filter them all) to be set?
Don't know how feasible it is, but if it's possible I'll work on a patch and tests.
