Notifications
Clear all

[Closed] Role Change doesn't sync on 2nd time.

5 Posts
2 Users
0 Reactions
505 Views
Posts: 4
Topic starter
(@matthewjr45)
Active Member
Joined: 2 years ago

Hi I'm working on a membership site which switches a user to an inactive role upon expiration/cancellation. Trouble is, the role change doesn't sync to WPForo unless somebody goes in and manually updates the user in the Wordpress back end. Is there a setting to overcome this? Usergroup synchronization is turned on, the role changes in Wordpress, all the front end navigation items and everything about the site reacts as it should except WPForo and the only resolution I'm finding is a manual process of clicking "update user" which... I hope there's an automation for this.

4 Replies
Robert
Posts: 10587
Admin
(@robert)
Support Team
Joined: 9 years ago

Hi @matthewjr45,

Try the following hook, put it in a PHP code snippet of the Code Snippets plugin or directly in the functions.php file of the current active WordPress theme:

add_action( 'set_user_role', function( $userid, $new_role, $old_roles = [] ){
delete_user_meta( intval( $userid ), '_wpf_member_obj' );
}, 10, 3 );
Posts: 4
Topic starter
(@matthewjr45)
Active Member
Joined: 2 years ago

It didn't work. 

1 Reply
Robert
Admin
(@robert)
Joined: 9 years ago

Support Team
Posts: 10587

@matthewjr45,

I'm really sorry, but I have no other solution. It means the membership plugin is not compatible with wpForo. I recommend contact the membership plugin support and ask them to make their plugin compatible with wpForo.

Posts: 4
Topic starter
(@matthewjr45)
Active Member
Joined: 2 years ago

Hrm. Let me rephrase and see if there's more you can offer? Ignoring that it's Memberpress. I'm trying to find the function that will simply hit the refresh button on a user profile when their membership level changes. I've been trying to crack this nut for a while now - any help would be so appreciated.