• Resolved Masalah Kewangan

    (@amirulamin950113)


    Hello.
    How can i set password reset minimum requirements 12-15 characters?
    I only found “require a strong password” in Settings > General > Users but i cant find anything to make it minimum character and maximum character as i do in registrations forms.
    Is there any way to modified that requirements?
    Thanks

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

    (@champsupertramp)

    Hi @amirulamin950113

    Please try this code snippet to change the minimum and maximum requirements:

    add_action( 'um_change_password_errors_hook','um_081821_change_password_errors_hook', 1  );
    function um_081821_change_password_errors_hook( $args ){
        if ( strlen( utf8_decode( $args['user_password'] ) ) < 12 ) {
            UM()->form()->add_error( 'user_password', __( 'Your password must contain at least 12 characters', 'ultimate-member' ) );
        }
    
        if ( strlen( utf8_decode( $args['user_password'] ) ) > 15 ) {
            UM()->form()->add_error( 'user_password', __( 'Your password must contain less than 15 characters', 'ultimate-member' ) );
        }
    
    }

    You can add the above code to your theme/child-theme’s functions.php file or use the Code Snippets plugin to run the code.

    Regards,

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @amirulamin950113

    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,

    Thread Starter Masalah Kewangan

    (@amirulamin950113)

    Hi.
    Just to let you know.
    It is work.
    Shouldn’t it be better if you put this options in the plugins itself so we can have options to set the value in options?
    Thanks

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @amirulamin950113

    We’ve provided filters and action hooks that are useful to extend and add extra functionalities especially for building small-scale to complex sites.

    Regards,

    • This reply was modified 3 years, 7 months ago by Champ Camba.
    Thread Starter Masalah Kewangan

    (@amirulamin950113)

    I mean in the plugins itself in general settings instead of manual hook in functions.
    Is it possible?
    Thanks

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @amirulamin950113

    We’ve got a lot of requests for adding extra settings to UM but we didn’t put them all as it will make the settings long and complex so providing UM hooks will allow developers and users to extend and modify the functionality and features to achieve their goals.

    Regards,

    • This reply was modified 3 years, 7 months ago by Champ Camba.
    • This reply was modified 3 years, 7 months ago by Champ Camba.
    Thread Starter Masalah Kewangan

    (@amirulamin950113)

    Hi.
    Is it possible if at least you put it in the documentation so user will be easy to find a way to do it instead of continous post in the forum.
    Right?
    Thanks.

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @amirulamin950113

    Thank you for your suggestion. I’ve created a doc about the code snippet:
    https://docs.ultimatemember.com/article/1630-modify-change-passwords-requirements-minimum-maximum

    Regards,

    Thread Starter Masalah Kewangan

    (@amirulamin950113)

    Thank you so much.
    Now it will be easier for other users to find a way by just reading the documentation.
    I hereby confirmed that this issue has been resolved.

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Thanks for letting us know.

    Regards,

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Password Reset minimum requirements’ is closed to new replies.