One list per user role
-
Hi, in another support ticket you give an insight into how to accomplish this, see: https://www.ads-software.com/support/topic/more-than-one-list-for-different-user-types/
I’ve built upon that code, but somehow can’t seem to get it to work. Am I missing something?
add_filter('rusac_fetch_registered_user_data', 'nmr_ac_sync_lists', 10, 2); function nmr_ac_sync_lists($user_data, $user_id) { $user = get_userdata( $user_id ); $roles = $user->roles; if ( in_array( 'member', $roles ) ) { $user_data['p[35]'] = 35; } elseif( in_array( 'prospect', $roles ) ) { $user_data['p[36]'] = 36; } elseif( in_array( 'customer', $roles ) ) { $user_data['p[37]'] = 37; } return $user_data; }
Any help would be much appreciated. Thanks.
UPDATE: Problem with original code found. Code has been updated to work. ??
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘One list per user role’ is closed to new replies.