Hi there!
Glad you reached out to us about this.
There is a function we use to sanitize URLs and make sure that they are safe. The link you’re using is sanitized because of the “:” and “/” characters.
You can allow the viber link by adding a PHP code snippet like this:
function allow_viber_in_esc_attr($safe_text, $text) {
if (strpos($text, 'viber://') === 0) {
return $text; // Return unescaped Viber link
}
return $safe_text;
}
add_filter('attribute_escape', 'allow_viber_in_esc_attr', 10, 2);
function allow_viber_protocol_in_urls($good_protocol_url, $original_url, $_context) {
if (strpos($original_url, 'viber://') === 0) {
return $original_url; // Keep the original Viber URL
}
return $good_protocol_url;
}
add_filter('clean_url', 'allow_viber_protocol_in_urls', 10, 3);
function allow_viber_in_esc_url($protocols) {
$protocols[] = 'viber';
return $protocols;
}
add_filter('kses_allowed_protocols', 'allow_viber_in_esc_url');
Here’s a guide on how you will add this safely: How to add a custom filter or function with Code Snippets
Lastly, I added a feature request for it.
I hope this helps and let me know if I can assist you further.
Thank you, I will do so! Please also add Viber to the list of social icons. I think many people still use it. Thank you for your concern! All the best!