Skip to content

Instantly share code, notes, and snippets.

@amdrew
Last active August 29, 2015 14:05
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 amdrew/1e62e7c13cc06260d2b8 to your computer and use it in GitHub Desktop.
Save amdrew/1e62e7c13cc06260d2b8 to your computer and use it in GitHub Desktop.
Easy Digital Downloads - Force minimum password length at checkout
<?php
function sumobi_edd_set_minimum_password_length( $valid_data, $post_data ) {
if ( strlen( $post_data['edd_user_pass'] ) < 8 ) {
edd_set_error( 'password_too_short', __( 'Please enter a password of 8 characters or more.', 'edd' ) );
}
}
add_action( 'edd_checkout_error_checks', 'sumobi_edd_set_minimum_password_length', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment