Code-Snippets-Functions/Execute a function on a child site/Easy Digital Downloads/force-minimum-password-length.txt

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 );