Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save champsupertramp/cbe74cbf0c2358617c7ee73c15a61065 to your computer and use it in GitHub Desktop.
Save champsupertramp/cbe74cbf0c2358617c7ee73c15a61065 to your computer and use it in GitHub Desktop.
Modify change passwords requirements( minimum & maximum )
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