Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Getting the current logged in user ID?


Kris
Participant

@kriyou

Rich, I love you. I’ll pass on the advice so that others might know how to do it.

At the top of /groups/index.php, you will see a H3 tag, with the ‘Create Group’ button next to it. This has a conditional around it to show the button if the user is logged in – this needs slight modification to check if the user is already part of a group. Define it first, above that tag:

$count = groups_total_groups_for_user( $bp->loggedin_user->id );

Around the button, the conditional was previously just for the ‘is_logged_in’ check, but I modified it to this:

if ( is_user_logged_in() && $count < 1

I am happy with the results, thank you Rich.

Skip to toolbar