attachment_fields_to_save filter-hookWP 2.5.0

Filters the attachment fields to be saved.

Usage

add_filter( 'attachment_fields_to_save', 'wp_kama_attachment_fields_to_save_filter', 10, 2 );

/**
 * Function for `attachment_fields_to_save` filter-hook.
 * 
 * @param array $post       An array of post data.
 * @param array $attachment An array of attachment metadata.
 *
 * @return array
 */
function wp_kama_attachment_fields_to_save_filter( $post, $attachment ){

	// filter...
	return $post;
}
$post(array)
An array of post data.
$attachment(array)
An array of attachment metadata.

Changelog

Since 2.5.0 Introduced.

Where the hook is called

media_upload_form_handler()
attachment_fields_to_save
wp_ajax_save_attachment_compat()
attachment_fields_to_save
edit_post()
attachment_fields_to_save
wp-admin/includes/media.php 792
$post = apply_filters( 'attachment_fields_to_save', $post, $attachment );
wp-admin/includes/ajax-actions.php 3220
$post = apply_filters( 'attachment_fields_to_save', $post, $attachment_data );
wp-admin/includes/post.php 435
$translated = apply_filters( 'attachment_fields_to_save', $translated, $attachment_data );

Where the hook is used in WordPress

Usage not found.