Replies: 0
I’m using Ultimate Member on a site I’m building for its amazing membership directory and user interface. I have 2 separate roles on the website, one is free and one is paid via a subscription. For the subscription aspect I’m installed Restrict Content Pro as recommended by Ultimate Member support. The issue I have is that when registering a new user via RCP, it doesn’t create the community role meta data needed. As the community role is key to the bespoke membership directory I’ve created for the paid role, it all goes wrong.
I’ve tried adding the following hook into functions.php to set the user meta, but it just ignores it.
function set_UM_role_properly( $user_id ) {
$user_id = get_current_user_id();
$role = get_user_meta( $user_id, ‘role’, true);
if (( $role == ‘member’ ) && ( $user_role != ‘member’ )) {
update_user_meta($user_id, ‘role’, ‘member’);
}
}
add_action(‘rcp_form_processing’, ‘set_UM_role_properly’);
Really appreciate any help.