Merge pull request #31701 from dhjw/autocomplete-signup
Enable browser-suggested passwords on checkout signup
This commit is contained in:
commit
2a4de35e24
|
@ -247,19 +247,21 @@ class WC_Checkout {
|
|||
|
||||
if ( 'no' === get_option( 'woocommerce_registration_generate_username' ) ) {
|
||||
$this->fields['account']['account_username'] = array(
|
||||
'type' => 'text',
|
||||
'label' => __( 'Account username', 'woocommerce' ),
|
||||
'required' => true,
|
||||
'placeholder' => esc_attr__( 'Username', 'woocommerce' ),
|
||||
'type' => 'text',
|
||||
'label' => __( 'Account username', 'woocommerce' ),
|
||||
'required' => true,
|
||||
'placeholder' => esc_attr__( 'Username', 'woocommerce' ),
|
||||
'autocomplete' => 'username',
|
||||
);
|
||||
}
|
||||
|
||||
if ( 'no' === get_option( 'woocommerce_registration_generate_password' ) ) {
|
||||
$this->fields['account']['account_password'] = array(
|
||||
'type' => 'password',
|
||||
'label' => __( 'Create account password', 'woocommerce' ),
|
||||
'required' => true,
|
||||
'placeholder' => esc_attr__( 'Password', 'woocommerce' ),
|
||||
'type' => 'password',
|
||||
'label' => __( 'Create account password', 'woocommerce' ),
|
||||
'required' => true,
|
||||
'placeholder' => esc_attr__( 'Password', 'woocommerce' ),
|
||||
'autocomplete' => 'new-password',
|
||||
);
|
||||
}
|
||||
$this->fields = apply_filters( 'woocommerce_checkout_fields', $this->fields );
|
||||
|
|
Loading…
Reference in New Issue