• Resolved mrkl

    (@he2014)


    We want to disable the fields for “password reset” and “change email address” for one certain user role. 
Or even hide the profile page for that user role.
    Important in the end – this users should not be able to edit the password or the email address.
    Can somebody help us, with the right hook we have to use?
    Or somebody have a code example?
    I know there are to settings to deactivate it globally – we need it only for this user role. thx

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Aswin Giri

    (@aswingiri)

    Hello @he2014

    You can prevent user role from editing their own profile. You can navigate to wp-admin > ultimate member > user roles > (Edit) and uncheck the checkbox for ‘Can edit their profile?‘;

    To remove password tab from account page, you can use following code snippets:

    add_filter('um_account_page_default_tabs_hook', function( $tabs ){
    $user_id = get_current_user_id();
    um_fetch_user($user_id);
    $role = UM()->user()->get_role();
    if($role == 'administrator'){
        unset($tabs[200]);
    }
    
    return $tabs;
        
    }, 100 );

    Please replace administrator with your own Role ID, I am just using administrator as an example.

    For password reset, are you trying to block access to forgot password page?

    Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Hey there!

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread by changing the Topic Status to ‘Not Resolved’ if any other questions come up and we’d be happy to help. 🙂

    Regards,

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘disable password reset for certain user rols’ is closed to new replies.