Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to hide the author of posts for unlogged users.

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

  • Robin W
    Moderator

    @robin-w

    this should hide it, but test to make sure you don’t find any exceptions !

    add_filter ('bbp_get_author_link' , 'rew_hide_author', 30 , 3 ) ;
    add_filter ('bbp_get_reply_author_link' , 'rew_hide_author', 30 , 3 ) ;
    add_filter ('bbp_get_topic_author_link' , 'rew_hide_author', 30 , 3 ) ;
    
    function rew_hide_author($author_link, $r, $args) {
    	if (!is_user_logged_in()) $author_link='' ;
    return $author_link ;
    }

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

    where %your-theme-name% is the name of your theme

    or use

    Code Snippets


    krzysztofzpom
    Participant

    @krzysztofzpom

    You’re amazing.

    Thank you so much.
    It works 🙂


    Robin W
    Moderator

    @robin-w

    great – glad you are fixed !

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