Created
August 23, 2013 14:13
-
-
Save anandkumar/6319754 to your computer and use it in GitHub Desktop.
Hide bbPress topics / replies / forums from public or non-logged in users.
This file contains hidden or 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
function pj_hla_logged_in_topics($have_posts){ | |
if (!is_user_logged_in()){ | |
$have_posts = null; | |
echo 'Login to see replies'; | |
} | |
return $have_posts; | |
} | |
add_filter('bbp_has_topics', 'pj_hla_logged_in_topics'); | |
add_filter('bbp_has_forums', 'pj_hla_logged_in_topics'); | |
add_filter('bbp_has_replies', 'pj_hla_logged_in_topics'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment