From 3c20c0ef2522a86f3167f4ce382b1d7b661d05f4 Mon Sep 17 00:00:00 2001 From: Boone B Gorges Date: Sat, 7 Nov 2015 22:22:18 -0600 Subject: [PATCH] Only logged-in user sshould see Follow button. See #7. --- includes/hooks-buddypress-follow.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/hooks-buddypress-follow.php b/includes/hooks-buddypress-follow.php index a51b405..79c9bb1 100644 --- a/includes/hooks-buddypress-follow.php +++ b/includes/hooks-buddypress-follow.php @@ -676,6 +676,11 @@ function cacsp_follow_add_follow_button_to_single_paper() { return; } + // Only logged-in users can follow papers. + if ( ! is_user_logged_in() ) { + return; + } + // Authors shouldn't see a follow button for their own papers. if ( bp_loggedin_user_id() === (int) get_post()->post_author ) { return;