Bug Pro 5.1 RC3 - Dynamic Content Telephone Link

Hi Team,

Experiencing strange behavour when using Dynamic Content with the Telephone link type.

I’m using an ACF fields but the same behaviour occurs with a hard coded string.

I store the number with whitespaces which is displayed on the frontend and remove whitespace for Phone link.

For example, create the following function

add_filter('cs_dynamic_content_phone_spaces', function ($result, $field, $args = array()) {

    $strip = isset($args['strip']) ? true : false;

    $phone = '+1 2 3 4 5';

    $result = $strip ? preg_replace('/\s+/', '', $phone) : $phone;

    return $result;

}, 10, 3);

Add a Headline Element and set the Content > Edit Text to {{dc:phone_spaces}} {{dc:phone_spaces strip="true"}} This should render correctly, with whitespace removed when strip=“true”.

Then enable Link on the Headline Element, choose link type Phone and set to {{dc:phone_spaces strip="true"}}. This will result in href="tel:%2B1%202%203%204%205" being rendered on the <a> tag.

The URL and Email types seem to work ok and strip the spaces, with URL removing the starting + and Email preserving it.

I’ve found the same problem with the Div and Column element when using an <a> tag. This is potentially a problem with all Elements that use the Link Types.

Hi @strobley,

Thanks for the heads up here. It’s a known conflict with using Dynamic Content and the Phone type of the Link control. If you need Dynamic Content in your phone URL it’s best to just use a regular link and prefix with tel: for now.

Thanks @alexander did not realise this is a know issue. Would be something that shall be resolved in a near term release or will remain?

It won’t be addressed in this release cycle. Most likely the next cycle.