image_attachment_fields_to_save
image_attachment_fields_to_save ( $post, $attachment )
Parameters:- (array) post The WP_Post attachment object converted to an array.
- (array) attachment An array of attachment metadata.
Returns:- (array) Filtered attachment post object.
Defined at: - Introduced in WordPress: 2.5.0
- Deprecated in WordPress: —
Description
Filters input from media_upload_form_handler() and assigns a default
post_title from the file name if none supplied.Illustrates the use of the {@see 'attachment_fields_to_save'} filter
which can be used to add default values to any field before saving to DB.