Skip to content

Instantly share code, notes, and snippets.

@ash-f
Created October 12, 2021 07:39
Show Gist options
  • Save ash-f/b7e34766f2bf7df0e6e2757cda7e8a05 to your computer and use it in GitHub Desktop.
Save ash-f/b7e34766f2bf7df0e6e2757cda7e8a05 to your computer and use it in GitHub Desktop.
WP Fluent Forms custom address format
function ff_address_custom_format( $data, $form ){
$fields = $data['fields'];
// change the order of array below for your country
$data['fields'] = array(
'country' => $fields['country'],
'zip' => $fields['zip'],
'state' => $fields['state'],
'city' => $fields['city'],
'address_line_1' => $fields['address_line_1'],
'address_line_2' => $fields['address_line_2']
);
return $data;
}
add_filter( 'fluentform_rendering_field_data_address', 'ff_address_custom_format', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment