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' ) ) {
|
if ( 'no' === get_option( 'woocommerce_registration_generate_username' ) ) {
|
||||||
$this->fields['account']['account_username'] = array(
|
$this->fields['account']['account_username'] = array(
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'label' => __( 'Account username', 'woocommerce' ),
|
'label' => __( 'Account username', 'woocommerce' ),
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'placeholder' => esc_attr__( 'Username', 'woocommerce' ),
|
'placeholder' => esc_attr__( 'Username', 'woocommerce' ),
|
||||||
|
'autocomplete' => 'username',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( 'no' === get_option( 'woocommerce_registration_generate_password' ) ) {
|
if ( 'no' === get_option( 'woocommerce_registration_generate_password' ) ) {
|
||||||
$this->fields['account']['account_password'] = array(
|
$this->fields['account']['account_password'] = array(
|
||||||
'type' => 'password',
|
'type' => 'password',
|
||||||
'label' => __( 'Create account password', 'woocommerce' ),
|
'label' => __( 'Create account password', 'woocommerce' ),
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'placeholder' => esc_attr__( 'Password', 'woocommerce' ),
|
'placeholder' => esc_attr__( 'Password', 'woocommerce' ),
|
||||||
|
'autocomplete' => 'new-password',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$this->fields = apply_filters( 'woocommerce_checkout_fields', $this->fields );
|
$this->fields = apply_filters( 'woocommerce_checkout_fields', $this->fields );
|
||||||
|
|
Loading…
Reference in New Issue