Opened 14 years ago
Closed 12 years ago
#20547 closed enhancement (fixed)
Ability to define post attachment status on insertion
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 3.9 | Priority: | normal |
| Severity: | normal | Version: | 3.4 |
| Component: | Media | Keywords: | dev-feedback |
| Focuses: | 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.
Attachments (2)
Change History (15)
#1
@
12 years ago
- Owner set to wonderboymusic
- Resolution set to fixed
- Status changed from new to closed
#3
@
12 years ago
- Focuses docs added
- Keywords needs-docs added
- Resolution fixed deleted
- Status changed from closed to reopened
#6
@
12 years ago
- Keywords dev-feedback added; needs-docs removed
- Resolution fixed deleted
- Status changed from closed to reopened
#9
@
12 years ago
20547.2.diff makes wp_insert_attachment() a wrapper for wp_insert_post(), negating the need for this new filter.
#10
in reply to:
↑ 8
@
12 years ago
Replying to wonderboymusic:
are you daring me to combine the two functions? IN-VES-TI-GATING.
I'm actually daring you to go all-in on #21963 :)
#11
follow-up:
↓ 12
@
12 years ago
oh wait, that already did all of this over there, will look at refreshing that
In 27130: