Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is it possible to remove a default attachment field from the attachment editor, for example the "Caption" field ?

To give you some context, I'm trying to build a custom attachment editor page. I found how to add custom fields, now I'd like to remove some of the default ones I don't need.

share|improve this question
    
possible duplicate of Trying to hide buttons from Attachment window –  t31os Apr 15 '11 at 12:10

2 Answers 2

up vote 2 down vote accepted

Use the attachment_fields_to_edit filter to remove the fields you don't want displaying from the array.

function remove_caption($fields) {
  unset($fields['post_excerpt']); // See wp-admin\includes\media.php line 1071
  return $fields;
}
add_filter('attachment_fields_to_edit','remove_caption');
share|improve this answer

Use js or css for hide fields or the solution from this thread or you use the plugin Adminimize and add your own options via ID of the elements.

share|improve this answer
    
Never, never, never use CSS to hide something that can just as easily be removed (which is almost always). –  Dan Feb 15 '13 at 23:15
    
Yes, you have right and I would to add the hint for this problem. –  bueltge Feb 20 '13 at 11:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.