Filters the attachment fields to be saved.
$postarray$attachmentarraywp-admin/includes/ajax-actions.php:3234wp_ajax_save_attachment_compat()wp-admin/includes/media.php:809media_upload_form_handler()wp-admin/includes/post.php:431edit_post() * * @see wp_get_attachment_metadata() * * @param array $post An array of post data. * @param array $attachment An array of attachment metadata. */ $post = apply_filters( 'attachment_fields_to_save', $post, $attachment ); if ( isset( $attachment['image_alt'] ) ) { $image_alt = wp_unslash( $attachment['image_alt'] ); if ( get_post_meta( $attachment_id, '_wp_attachment_image_alt', true ) !== $image_alt ) { $image_alt = wp_strip_all_tags( $image_alt, true );Introduced in 2.5.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.