• Ever since you updated the ultimate member, my form is not displaying the phone number at all. After looking at the code, I found these issues.

    I have a custom function that is hooked in using your provided hooks, and it’s shown at the bottom for verification purposes. It just makes the phone number look pretty and adds an SMS link.

    The problem is, this is what is now getting fed as a value into the function.

    81855551008185555100

    There’s 2 phone numbers back-to-back, and when try to echo it inside my function, it will display 3 phone numbers back-to-back.

    818555510081855551008185555100

    This is making it not work. I’m not sure what you did but if you could get it fixed soon that would be awesome.

    Everything was working prior to the update, as of 2 weeks ago.

    add_filter('um_profile_field_filter_hook__mobile_number', 'um_profile_field_filter_hook__mobile_number', 99, 2);
    function um_profile_field_filter_hook__mobile_number( $value, $data ) {
    	$raw = deformat_phone($value);
    	$value = format_phone( $value );
    	$output = "<a href='tel:".$raw."' onclick='phone_contact_conversion()'>".$value."</a>";
    	return $output;
    }
    • This topic was modified 3 years, 9 months ago by baddon250.
    • This topic was modified 3 years, 9 months ago by baddon250.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • @baddon250

    In UM version 2.5.0 the <a href='tel: is the standard formatting option for phone and mobile numbers.

    2.5.0: August 17, 2022

    Enhancements:
    Added: Input type “tel” using for the “Mobile Number” and “Phone Number” fields

    Thread Starter baddon250

    (@baddon250)

    How do I format the phone number?

    Currently it looks like this: 1234567890

    I want it to look like this: (123) 456-7890

    And still have the Tel link

    @baddon250

    Try to remove the UM filter and change your function name:

    remove_filter( 'um_profile_field_filter_hook__mobile_number', 'um_profile_field_filter_hook__phone', 99, 2 );
    add_filter('um_profile_field_filter_hook__mobile_number', 'custom_profile_field_filter_hook__mobile_number', 99, 2);
    
    function custom_profile_field_filter_hook__mobile_number( $value, $data ) {
    	$raw = deformat_phone($value);
    	$value = format_phone( $value );
    	$output = "<a href='tel:".$raw."' onclick='phone_contact_conversion()'>".$value."</a>";
    	return $output;
    }
    Thread Starter baddon250

    (@baddon250)

    That did the trick, everything looks formatted and beautified.

    Thanks a bunch!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘URGENT: GLITCH’ is closed to new replies.