Skip to content

Instantly share code, notes, and snippets.

@caratage
Created November 28, 2012 13:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caratage/4161104 to your computer and use it in GitHub Desktop.
Save caratage/4161104 to your computer and use it in GitHub Desktop.
Remove fields from Media Uploader overlay
// edit fields in media upload area
add_filter('attachment_fields_to_edit', 'remove_media_upload_fields', 10000, 2);
function remove_media_upload_fields( $form_fields, $post ) {
// remove unnecessary fields
unset( $form_fields['image-size'] );
unset( $form_fields['post_excerpt'] );
unset( $form_fields['post_content'] );
unset( $form_fields['url'] );
unset( $form_fields['image_url'] );
unset( $form_fields['align'] );
unset( $form_fields['image_alt'] );
return $form_fields;
}
// print_r($formfields); to see what you can add/remove
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment