I used this code written in functions.php file to add extra UM fields (we can find in UM registration form):
/* add custom user fields */
add_action('um_after_account_general', 'showUMExtraFields', 100);
function showUMExtraFields()
{
$id = um_user('ID');
$output = '';
$names = array(
'phone_number',
'company_name',
'job',
'street',
'zipcode',
'city'
);
$fields = array();
foreach( $names as $name )
{
$fields[ $name ] = UM()->builtin()->get_specific_field( $name );
}
$fields = apply_filters('um_account_secure_fields', $fields, $id);
foreach( $fields as $key => $data )
$output .= UM()->fields()->edit_field( $key, $data );
echo $output;
}
The $names
variable is an array of meta key. This meta key is set in field settings.
Thanks to this function, UM will populate automatically the fields in account.