Last active
January 2, 2016 22:59
-
-
Save messaoudi-mounir/8373632 to your computer and use it in GitHub Desktop.
Buddypress : This code hide comments for no logged in users
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add the code to functions.php of your current theme. | |
* this code hide comments for no logged in users | |
*/ | |
add_filter( 'bp_activity_get_comment_count' , 'bp_only_loggedin_can_see_comments', 10,1 ); | |
function bp_only_loggedin_can_see_comments( $count ){ | |
if ( !is_user_logged_in() ) | |
$count = 0; | |
return $count; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment