attachment_fields_to_edit filter-hookWP 2.5.0

Filters the attachment fields to edit.

Usage

add_filter( 'attachment_fields_to_edit', 'wp_kama_attachment_fields_to_edit_filter', 10, 2 );

/**
 * Function for `attachment_fields_to_edit` filter-hook.
 * 
 * @param array   $form_fields An array of attachment form fields.
 * @param WP_Post $post        The WP_Post attachment object.
 *
 * @return array
 */
function wp_kama_attachment_fields_to_edit_filter( $form_fields, $post ){

	// filter...
	return $form_fields;
}
$form_fields(array)
An array of attachment form fields.
$post(WP_Post)
The WP_Post attachment object.

Changelog

Since 2.5.0 Introduced.

Where the hook is called

get_attachment_fields_to_edit()
attachment_fields_to_edit
get_compat_media_markup()
attachment_fields_to_edit
wp-admin/includes/media.php 1509
$form_fields = apply_filters( 'attachment_fields_to_edit', $form_fields, $post );
wp-admin/includes/media.php 1935
$form_fields = apply_filters( 'attachment_fields_to_edit', $form_fields, $post );

Where the hook is used in WordPress

wp-admin/async-upload.php 87
add_filter( 'attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2 );
wp-admin/async-upload.php 97
add_filter( 'attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2 );
wp-admin/includes/media.php 2373
add_filter( 'attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2 );
wp-admin/includes/media.php 2596
<?php add_filter( 'attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2 ); ?>
wp-admin/includes/media.php 2906
<?php add_filter( 'attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2 ); ?>