Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Character limitation for Address Fields
<?php
add_filter( 'wfacp_forms_field', function($field,$key){
if($key=='billing_number' || $key=='shipping_number'){
$field['custom_attributes']['maxlength']=8;
}
else{
if($key=='billing_address_2' || $key=='shipping_address_2'){
$field['custom_attributes']['maxlength']=25;
}
}
return $field;
},10,2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment