attachment_fields_to_edit
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
attachment_fields_to_edit
wp-admin/includes/media.php 1526
$form_fields = apply_filters( 'attachment_fields_to_edit', $form_fields, $post );
wp-admin/includes/media.php 1954
$form_fields = apply_filters( 'attachment_fields_to_edit', $form_fields, $post );
Where the hook is used in WordPress
wp-admin/async-upload.php 86
add_filter( 'attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2 );
wp-admin/async-upload.php 96
add_filter( 'attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2 );
wp-admin/includes/media.php 2397
add_filter( 'attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2 );
wp-admin/includes/media.php 2620
<?php add_filter( 'attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2 ); ?>
wp-admin/includes/media.php 2929
<?php add_filter( 'attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2 ); ?>