Customize the upload screen

You will need to hook into attachment_fields_to_edit and unset them for a role.

You can use current_user_can('author')
http://codex.wordpress.org/Function_Reference/current_user_can

Example to remove image alt field

function remove_caption($form_fields) {

  if (current_user_can('author')){
   $form_fields['image_alt']['input'] = 'hidden';
   return $form_fields;
}}
add_filter('attachment_fields_to_edit','remove_caption', 15, 2);

My initial post used unset but I tried it and it did not work, from the example in this post: How can I remove fields in the attachment editor? , not sure why, instead the example above works using hidden.

Leave a Comment