0

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');
}
1

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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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