This post shows how to remove unwanted fields from the media uploader. It works great, but I want to limit it to a custom-post-type and I can't seem to figure out how to do it. I've tried the following code, but it doesn't seem to work:
add_filter('attachment_fields_to_edit', 'remove_media_upload_fields', 10000, 2);
function remove_media_upload_fields( $form_fields, $post ) {
global $my_admin_page;
$screen = get_current_screen();
if ( 'slider' == $screen->post_type ){
unset( $form_fields['image-size'] );
unset( $form_fields['post_excerpt'] );
unset( $form_fields['url'] );
unset( $form_fields['image_url'] );
unset( $form_fields['align'] );
}
return $form_fields;
}
Any ideas on how to get this to work?
Thanks,
Moshe