The escaping function is adding it, esc_url
guarantees that what it returns will be a URL, as it’s an escaping function, and so it should, if you’re outputting a URL you should use esc_url
so that it’s safe and definitely a URL and not something else maliciously snuck in.
The confusion here though, is that things are getting muddled up. The textbox is not supposed to contain a Skype username, it’s meant to contain a Skype URL.
A skype url when clicked on, opens the Skype app, and starts a call with you. I believe they look like this: skype:username?chat
Think of it another way. If the theme presents just a skype icon, and you enter a skype username into the box, what happens when you click the skype icon?
Suffice to say, you will need to do multiple things to change it from a skype URL to a skype username:
- Replace
esc_url
withesc_attr
- Re-implement the frontend code to display a skype username rather than a clickable skype URL link, and that it uses
esc_html
notesc_url
- Look up the saving code to make sure it sanitises as a HTML string, not a URL
Note that all of these changes will be lost if you ever update the theme. You’re not supposed to directly modify themes as you’re doing, but create child themes instead