Galleries cannot be accessed.

4 Replies ·

  1. hi

    I’ve been trying to find this, unfortunately success loss. As this topic already gives please simply the link post.

    I have galleries. But I can’t protect them. I have tried to hide with your program and a created role.

    but it doesn’t work.

    However, you must login to do this. Where can I send you the access data?


  2. Justin Tadlock

    Are galleries a custom post type that you’ve created? I’m not sure I understand the question.

    Or, are you talking about the images in a normal WordPress gallery? Image files cannot be protected without a custom plugin built for that and custom .htaccess handling, which is outside the scope of Members.

    If you need to give me any access to your site, you can send me a private message through the Theme Hybrid Slack Chat.

  3. Michael Campos Viola

    Thanks for the answer.

    so I have a phenomenon. I use a special kind of themes. I already had to realize that.

    Please have a look.

    Here are all galleries with your program with rights assigned. Nevertheless they are publicly visible.

    I don’t think it’s the problem with your application. But maybe you have an idea why this can be?


  4. Justin Tadlock

    The Members plugin has a Content Permissions meta box for selecting which roles can see the content. And, this literally means the $post->post_content from the database, which is the content entered into the post editor. In order for it to be hidden, the theme must output this with the <?php the_content() ?> (this is the standard).

    If you’re using some sort of page builder, they sometimes do things in non-standard ways. In that case, you’ll likely need to ask the theme/plugin author how to integrate the below with their project.

    If you’re outputting something in a different way, you must write code to hide it within your theme template or plugin (whichever is displaying the gallery). You can wrap the output code with the members_can_current_user_view_post() function like so:

    <?php if ( members_can_current_user_view_post() ) : ?>
        Output your gallery here.
    <?php endif; ?>