mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-05-01 11:52:25 +08:00
https://github.com/easydigitaldownloads/library/blob/master/_checkout/force-minimum-password-length.html
11 lines
426 B
Text
11 lines
426 B
Text
function sumobi_edd_set_minimum_password_length( $valid_data, $post_data ) {
|
|
|
|
// how many characters should the password be?
|
|
$length = 8;
|
|
|
|
if ( strlen( $post_data['edd_user_pass'] ) < $length ) {
|
|
edd_set_error( 'password_too_short', sprintf( __( 'Please enter a password of %s characters or more.', 'edd' ), $length ) );
|
|
}
|
|
|
|
}
|
|
add_action( 'edd_checkout_error_checks', 'sumobi_edd_set_minimum_password_length', 10, 2 );
|