Skip to content

Instantly share code, notes, and snippets.

@xlplugins
Last active May 5, 2021 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save xlplugins/f18a180beb469d59437c852f2d4f8b41 to your computer and use it in GitHub Desktop.
Save xlplugins/f18a180beb469d59437c852f2d4f8b41 to your computer and use it in GitHub Desktop.
Character limitation for Address Fields
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