add/27803 add support for minlength in the template (#37840)

This commit is contained in:
Ron Rennick 2023-04-20 14:09:04 -03:00 committed by GitHub
commit 2ece044c6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: add
add support for minlenght in the template

View File

@ -2772,6 +2772,7 @@ if ( ! function_exists( 'woocommerce_form_field' ) ) {
'description' => '',
'placeholder' => '',
'maxlength' => false,
'minlength' => false,
'required' => false,
'autocomplete' => false,
'id' => $key,
@ -2817,6 +2818,10 @@ if ( ! function_exists( 'woocommerce_form_field' ) ) {
$args['custom_attributes']['maxlength'] = absint( $args['maxlength'] );
}
if ( $args['minlength'] ) {
$args['custom_attributes']['minlength'] = absint( $args['minlength'] );
}
if ( ! empty( $args['autocomplete'] ) ) {
$args['custom_attributes']['autocomplete'] = $args['autocomplete'];
}