add/27803 add support for minlength in the template (#37840)
This commit is contained in:
commit
2ece044c6c
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: add
|
||||
|
||||
add support for minlenght in the template
|
|
@ -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'];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue