-
-
Save roscabgdn/47acb31a24f52374d7487f1889be3f4d to your computer and use it in GitHub Desktop.
WC Vendors - Notify anyone registering in WooCommerce on Checkout or My Account Page about strong password requirement.
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
OPTION 1 - Add a warning that you need a stronger password. | |
/* WC Vendors - Add a "Need a strong password" notice to the My Account Page */ | |
add_action( 'woocommerce_register_form', 'wcvendors_notify_password_myaccount' ); | |
function wcvendors_notify_password_myaccount() { | |
echo '<strong>Important</strong> -- This site respects your security. We require all new members to use a strong password. If you can not click the Register button, <strong>you need a stronger password</a>.<br><br>'; | |
} | |
/* WC Vendors - Add a "Need a strong password" notice to the Checkout Page */ | |
add_action( 'woocommerce_after_checkout_registration_form', 'wcvendors_notify_password_checkout' ); | |
function wcvendors_notify_password_checkout() { | |
echo '<strong>Important</strong> -- This site respects your security. We require all new members to use a strong password. If you can not click the Place Order button, <strong>you need a stronger password</a>.'; | |
} | |
OPTION 2: Disable the entire password check all together, and allow passwords like abcd1234 to be used. | |
/* WC Vendors Disable WooCommerce Password Strength Requirement */ | |
function wcvendors_remove_password_strength() { | |
if ( wp_script_is( 'wc-password-strength-meter', 'enqueued' ) ) { | |
wp_dequeue_script( 'wc-password-strength-meter' ); | |
} | |
} | |
add_action( 'wp_print_scripts', 'wcvendors_remove_password_strength', 100 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment