How do I remove the Insert from URL
link in the new WordPress 3.5 Add Media popup page? In earlier versions of WordPress, this worked fine:
// removes URL tab in image upload for post
function remove_media_library_tab($tabs) {
if (isset($_REQUEST['post_id'])) {
$post_type = get_post_type($_REQUEST['post_id']);
if ('premium' == $post_type)
unset($tabs['library']);
unset($tabs['type_url']);
}
return $tabs;
}
add_filter('media_upload_tabs', 'remove_media_library_tab');
Who knows?
This should work:
The code of default tabs array in new WP is in media.php and looks like this:
If you want only remove upload from url by default you shoud change your function to:
Not tested but it should work fine.
Edit: Not work because this array is used in other place.
If you want just remove the link you can use this work around: