I use the media uploader in a own meta-box for a custom post type called “premium”.
The Thickbox opens after a click of the button in the meta-box and files can be uploaded.
Now I want to remove the tabs “From URL” and “Library” only when used the uploader in the edit/new-page for the CPT or if possible with the call of the click-event.
I have no idea how to resolve.
P.S.:
I use this js for calling the thickbox and tried to remove a tab via jQuery:
jQuery(document).ready(function() {
jQuery('#pc_extContent_button').click(function() {
formfield = jQuery('#pc_extContent').attr('name');
tbframe_interval = setInterval(function() {
jQuery('#tab-type_url').hide();
}, 2000);
tb_show('', 'media-upload.php?type=file&TB_iframe=true')
return false;
});
You can use the
media_upload_tabs filter
check for your post type and unset any tab you don’t want ex:First it is necessar to change the JavaScript for including the post_id in the request:
Then the solution of Bainternet can be used in the functions.php (or similar)
So all works fine together and the tabs are removed.