Skip to:
Content
Pages
Categories
Search
Top
Bottom

Check if post is visible to user

  • @ronz

    Participant

    Hello,

    Is there a way to check if post is visible to user, i’m doing a template and i dont find a way to check if the page is visible to the member logged in.

    WP 4.2.2 / BBP 2.5.8

Viewing 15 replies - 1 through 15 (of 15 total)
  • @robkk

    Moderator

    @ronz

    Participant

    Yep, i know this one, but i want to know if user can view the post. If its an admin page or a group post etc…

    @pinkishhue

    Participant

    This plugin is really handy for logging in as different users/user levels:

    https://wordpress.org/plugins/user-switching

    @ronz

    Participant

    Is there a website where functions are listed ?

    @robkk

    Moderator

    @ronz

    If you are using the User Switching plugin you switch to a user by going to Users > All Users then searching for that user and clicking the switch to link. You can also switch to the user by visiting their profile in the backend or frontend.

    @ronz

    Participant

    I ment doing it with a function in code =)

    @robkk

    Moderator

    using the plugin is probably better.

    @ronz

    Participant

    I am doing a list of forums for exemple, and i want to control (in the loop) if current user can access to the forum before showing it in the list.

    @robkk

    Moderator

    is the forum private or hidden?? what could disallow them access??

    @ronz

    Participant

    Yep its a forum for a group, all works fine thats just when i list forums they can see forums of groups etc

    @robkk

    Moderator

    is it BuddyPress, and its groups feature??

    @ronz

    Participant

    Yep

    @robkk

    Moderator

    There might be a conditional to use for that too, do not know really where to put the conditional in a template though.

    I will come back to this topic after finding out.

    @ronz

    Participant

    Any good news ? šŸ˜€

    @robkk

    Moderator

    Maybe this? Not 100% sure though, if you haven’t contact BuddyPress support.

    if ( is_user_logged_in() || bp_group_is_member() )

Viewing 15 replies - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.
Skip to toolbar