Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @dgtalgoodies

    Sorry, but It’s not clear. Do you want to create a custom email template with the Reset Password link?

    Regards,

    Thread Starter dgtalgoodies

    (@dgtalgoodies)

    Hi there, basically I want to remove/disable the option for users to request a password reset using their username. Thank you

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @dgtalgoodies

    This requires customization on your end. You can try the following code snippet:

    add_filter("gettext_ultimate-member","um_021522_change_reset_password_labels", 10, 3);
    function um_021522_change_reset_password_labels( $translation, $text, $domain ){
     
         if( "To reset your password, please enter your email address or username below." == $text ){
             $translation = "To reset your password, please enter your email address below.";
         }else if( "Enter your username or email" == $text ){
             $translation = "Enter your email address";
         }else if( "Please provide your username or email" == $text ){
             $translation = "Please provide your email address";
         }
     
         return $translation;
     }
     
     add_action( 'um_reset_password_errors_hook', "um_021522_reset_password_error" );
     function um_021522_reset_password_error( $args ){
    
        foreach ( $args as $key => $val ) {
            if ( strstr( $key, 'username_b' ) ) {
                $user = trim( sanitize_text_field( $val ) );
            }
        }
    
        if ( username_exists( $user ) ) {
            UM()->form()->add_error( 'username_b', __( 'Please provide your email address', 'ultimate-member' ) );
        }
     }

    The above code will reject the username in the Reset Password form. You can add the code to your theme/child-theme’s functions.php file or use the Code Snippet plugin to run the code.

    Regards,

    Thread Starter dgtalgoodies

    (@dgtalgoodies)

    Once again your help is greatly appreciated, Thank you, buddy ??

    Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Thanks for letting us know.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Reset password by email only’ is closed to new replies.