The media_upload_tabs filter passes a single argument containing an
array of the tabs, you can unset() them to remove them.
The array looks something like this:
Array
(
[type] => From Computer
[type_url] => From URL
=> Gallery
[library] => Media Library
)
to remove the media library tab:
function remove_media_library_tab($tabs) {
unset($tabs['library']);
return $tabs;
}
add_filter('media_upload_tabs', 'remove_media_library_tab');
If you only want to hide it on certain posts or post_types you can check the $_REQUEST or $_GET args. When using the ‘Upload/Insert’ links several points of data are passed along: /wp-admin/media-upload.php?post_id=28506&type=image&TB_iframe=1&width=640&height=581
function remove_media_library_tab($tabs) {
if (isset($_REQUEST['post_id'])) {
$post_type = get_post_type($_REQUEST['post_id]);
if ('post' == $post_type)
unset($tabs['library']);
}
return $tabs;
}
add_filter('media_upload_tabs', 'remove_media_library_tab');
Hope that helps