Remove Library Tab from Post-Side Media Pop-Up

I’m working on a plugin right now where I’m having to hide or limit a lot of features depending on the current user’s capabilities. Among those limitations is media uploading and editing access. I’m using this snippet to hide the Media Library tab from the Add an Image pop-up on the edit post page.

function no_library_tab($tabs) {
    if (!current_user_can('promote_users')) { 
    return $tabs;

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: