WordPress.org

Ready to get started?Download WordPress

Forums

Virtue
[resolved] block subscriber from viewing the whole library (8 posts)

  1. Dddt
    Member
    Posted 1 year ago #

    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

  2. Kadence Themes
    Member
    Theme Author

    Posted 1 year ago #

    I'm not sure I understand what you are trying to do, I think this would be a better question for general support as it's not theme related.

    .. Does this have to do with a plugin that allows some kind of subscription?

    Kadence Themes

  3. Dddt
    Member
    Posted 1 year ago #

    yes, this is with plugin "frontier post". this plugin enables subscribers to post on frontend and gives access to whole media library of the website which is not right thing.

    the code above is suggested to be added to theme functions.php which will remove the media library tab for everyone besides admin while uploading media into the post.

  4. Dddt
    Member
    Posted 1 year ago #

  5. Dddt
    Member
    Posted 1 year ago #

  6. Kadence Themes
    Member
    Theme Author

    Posted 1 year ago #

    You need to asked the plugin support for more guidance as I don't know how there plugin works. But if you are going to add a function I suggest you create a child theme and add that function in the child theme.

    Kadence Themes

  7. Dddt
    Member
    Posted 1 year ago #

    Ok, thanks, I will update what I got

  8. Dddt
    Member
    Posted 12 months ago #

    I have figured this out.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic