Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I use wp_enqueue_script('media-upload') show upload box,but i don't want show "Media Library" I use upload for frontend and don't want remove it on backend. Can you help me modify it Thanks

I fixed this problem

if(current_user_can('subscriber')){
    function remove_media_library_tab($tabs) {
            unset($tabs['library']);
        //    unset($tabs['type_url']);

        return $tabs;
    }
    add_filter('media_upload_tabs', 'remove_media_library_tab');
}
share|improve this question
    
possible duplicate of wordpress.stackexchange.com/questions/46808/… –  Bainternet Mar 28 '12 at 11:36
add comment

1 Answer

I'm not sure it has to do with enqueueing, if all you want to do is hide the Media Library tab in the media upload window.

I found the following solution (haven't tried it myself):

function remove_media_library_tab($tabs) {
     unset($tabs['library']);
     return $tabs;
}
add_filter('media_upload_tabs', 'remove_media_library_tab');

The link contains some more details as to why this is what needs to be done

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.