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:

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.

Related Functions

image_attachment_fields_to_edit, get_attachment_fields_to_edit, media_single_attachment_fields_to_edit, media_post_single_attachment_fields_to_edit, get_attachment_icon_src

Top Google Results

User discussions

wpseek mobile