Does wpforo works together with memberpress ?
Hi @pikapower,
We're currently working on this. It'll available in near future releases.
I've been working with Memberpress / wpForo integration all year. Even though the Memberpress role synchronization add-on only updates WP secondary roles, it kinda worked as wpForo catches the add_user_role action. As long as one doesn't manually re-synchronize the wpForo usergroups, member usergroup access does get updated on signup.
Where the wheels eventually fell off was on membership role expirations. Memberpress processes these through a wp cron job and A: it's buggy as hell, plus B: wpForo doesn't notice the role removals. I've got a LOT of membership expirations coming up over the next couple months so I had to get something working. I ended up scrapping the user role synchronization in both Memberpress and wpForo and added an action hook that monitors all Memberpress membership events. If you're comfortable in PHP (and editing your functions.php file), this should give you some ideas...
//Note expiration events run 24 hours behind. Pretty sure it's a Memberpress bug...
add_action('mepr-event-create', 'listen_to_mepr_events');
function listen_to_mepr_events($event) {
$obj = $event->get_data();
if(!($obj instanceof MeprTransaction) && !($obj instanceof MeprSubscription)) {
return; // nothing to do here if we're not dealing with a txn or sub
}
$member = $obj->user();
if($member->is_active_on_membership($obj)) { //active membership
if(674 == $obj->product_id) { //guest trial
WPF()->member->set_usergroup( $member->ID, "3" );
}
else { //all paid members
WPF()->member->set_usergroup( $member->ID, "5" );
}
}
else { //inactive membership
WPF()->member->set_usergroup( $member->ID, "11" );
}
}
@3d0g thank you for your help.
I'm using Memberpress and while it assigns an additional role to a new paying user, WPforo only recognizes the initial role and not the new one.
I want to allow unpaid members to access some parts of the forum on a read-only basis.
Instead of using roles, I could restrict the entire forum and only allow paying members to access it, but I want to avoid that.
ย
Any ideas how to get that? Shouldn't WPforo recognize dual roles?
Thank you