Add filter wp_insert_attachment_data mirroring wp_insert_post_data
|Reported by:||israelshirk||Owned by:|
In commercial applications it's handy to use the wp_insert_post_data filter in wp_insert_post() to control attributes of a post being inserted based on the user's role and other variables. We're using this to force content to go through a complex approval process which runs off of the post status.
wp_insert_attachment() does not have a similar filter, which makes content approval processes difficult to implement.
This patch adds a filter named wp_insert_attachment_data filter to wp_insert_attachment() which mirrors the form and functionality in wp_insert_post().