Created
August 24, 2021 07:51
-
-
Save champsupertramp/cbe74cbf0c2358617c7ee73c15a61065 to your computer and use it in GitHub Desktop.
Modify change passwords requirements( minimum & maximum )
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' ) ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment