Skip to main content

Role Based logins for Paid Memberships

Hey Hey, how are you all handling role based logins for memberships? This is the use case I am running into when people try to renew their membership if payment failed or they cancelled in the past: Right now users can only access the portal if they have a role of "Subscriber". However if they cancel and want to sign back up, if they go back to the Fluent Community login page and sign in, it completely blocks them from being able to access the account page for them to renew their membership. I have tried role based sign in plugins to try to redirect them, however it seems like FluentCommunity permissions is a higher permission so it is ignore the roles for people who are not members and not redirecting to the account page for them to sign up again.

Also, when the error messages shows up telling them they need to signup, i am not able to control where that "Go to home page" button goes to, it keeps going back to the home page, even though i have the account page set.

Shahjahan Jewel Is this something that can be improved? right now i have members that can't sign back up for a paid membership nor update credit card info etc.

Role Based logins for Paid Memberships

Debo Ogunrinde

Tambria Kemp have you considered using different tags to segment members instead of roles?

Tambria Kemp

Debo Ogunrinde Yeah, i tried that first but the issue i ran into with that is that we have a number of people who are Free(Grandfathered) and we don't want them to have access to paid content. So when i was using tags, they were getting out of sync when people cancel and come back etc. Sometimes it would remove and put the tag back correctly sometimes it would not. Especially in situation where their card may fail and the card automatically retries a few times, it wouldn't put them back with that tag. I found myself having to manually go through hundreds of paid members and making sure they have the correct tag. It seems to handle roles better for some reason

You can use the code snippet to check the user profile and give them access:

add_filter('fluent_community/can_access_portal', function ($canAccess) {
    if($canAccess) {
        return $canAccess;
    }

    $currentUser = get_user_by('ID', get_current_user_id());

    if(!$currentUser) {
        return $canAccess;
    }

    // Check your user and return true if you want to give access to the portal
    return $canAccess;

});