How to Change WooCommerce Password Hint

A while ago I was working on a site where I have to change the WooCommerce Password Hint label. Its so common request for user So I thought to share the code snippets with you guys.

/**
 * Change WooCommerce Password Message.
 *
 */
function bnd_woo_custom_password_message( $params, $handle ) {
  if ( $handle === 'wc-password-strength-meter' ) {
      $params['i18n_password_hint']    = esc_attr__( 'The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ & ).', 'woocommerce' );
      $params['i18n_password_error']   = esc_attr__( 'Please enter a stronger password.', 'woocommerce' );
  }

  return $params;
}
add_filter( 'woocommerce_get_script_data', 'bnd_woo_custom_password_message', 10, 2 );

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *