Skip to:
Content
Pages
Categories
Search
Top
Bottom

Hiding replies for non-loggedin users


  • unterwegsinberlin
    Participant

    @unterwegsinberlin

    Hi,

    my forum is rather sensitive in form of private issues and problems. I would like to hife all replies for not logged-in users. How do I do this?

    best
    Christine

Viewing 3 replies - 1 through 3 (of 3 total)

  • wpturk
    Participant

    @wpturk

    you can try something like this:

    function custom_logged_in_replies($posts){
        if (!is_user_logged_in()){
            $posts = null;
                echo 'Login to see the replies';
        }
        return $posts;
    }
    
    add_filter('bbp_has_replies', 'custom_logged_in_replies');

    wpturk
    Participant

    @wpturk

    you need to put this in your functions.php (better child theme)


    unterwegsinberlin
    Participant

    @unterwegsinberlin

    Great thanks!

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