WordPress.org

Support

Support » Themes and Templates » [Resolved] block subscriber from viewing the whole library

[Resolved] block subscriber from viewing the whole library

  • hello friend

    I need to block subscribers from viewing the whole library when ther are posting on my website, I found the following code for

    functions.php

    //Remove Media Library Tab
    function remove_medialibrary_tab($tabs) {
    if ( !current_user_can( ‘administrator’ ) ) {
    unset($tabs[‘library’]);
    return $tabs;
    }
    else
    {
    return $tabs;
    }
    }
    add_filter(‘media_upload_tabs’,’remove_medialibrary_tab’);

    I am writing you to ask whether there is easier way through CSS which will do the same function for this theme? if where should I exactly place this code in functions.php?

    thanks in advance

Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] block subscriber from viewing the whole library’ is closed to new replies.