Opened 13 years ago
Closed 13 years ago
#17895 closed enhancement (fixed)
delete_post_thumbnail()
Reported by: | nacin | Owned by: | nacin |
---|---|---|---|
Milestone: | 3.3 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Post Thumbnails | Keywords: | has-patch needs-testing dev-feedback commit |
Focuses: | Cc: |
Description
set_post_thumbnail() should allow deletes too, by passing false or 0 as the new ID. Or we can add delete_post_thumbnail().
The set-post-thumbnail admin-ajax branch will need a rework to support it.
Attachments (4)
Change History (18)
#4
follow-up:
↓ 10
@
13 years ago
- Keywords has-patch needs-testing added
Still need to work through the admin-ajax branch function.
#5
@
13 years ago
- Milestone changed from Future Release to 3.3
- Summary changed from set_post_thumbnail() should allow deletes too to delete_post_thumbnail()
#8
@
13 years ago
- Keywords 3.3-early removed
- Owner misternifty deleted
- Status changed from accepted to assigned
I would go with delete_post_thumbnail().
#9
@
13 years ago
- Keywords dev-feedback added
Leads/committers: please weigh in on commit vs. punt based on current patch, given freeze.
#10
in reply to:
↑ 4
;
follow-up:
↓ 11
@
13 years ago
Replying to CoenJacobs:
Still need to work through the admin-ajax branch function.
17895.diff. Changed it to return the return value of delete_post_meta
.
I'm a bit unsure about returning false if there's no post, but returning true if there's a post with no thumbnail. Seems to me that both cases should return the same? Otherwise should be good :)
#11
in reply to:
↑ 10
;
follow-up:
↓ 12
@
13 years ago
Replying to duck_:
17895.diff. Changed it to return the return value of
delete_post_meta
.
I'm a bit unsure about returning false if there's no post, but returning true if there's a post with no thumbnail. Seems to me that both cases should return the same? Otherwise should be good :)
Sounds good to me.
Returning false when the delete isn't executed because of no set value in the meta is a choice indeed. Doesn't delete_post_meta (and thus delete_metadata() ) return false too, if there are no records to delete?
#12
in reply to:
↑ 11
@
13 years ago
- Keywords commit added
Replying to CoenJacobs:
Doesn't delete_post_meta (and thus delete_metadata() ) return false too, if there are no records to delete?
Correct. 17895.2.diff.
+1 for delete_post_thumbnail(), not sure false or 0 on a set function would be expected behaviour given other functions have a delete counterpart.