WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If I try to add a skype username as the URL for a wp_nav_menu item, the item is saved but the URL is not.

The username URL is in the following format:

skype:example?call

Any thoughts on add skype: as an acceptable protocol?

Thanks.

share|improve this question
    
Just to clarify, this is concerning the menus under apperance > menu. – addedlovely Jan 9 '12 at 22:55

I believe the esc_url function is what ultimately filters the url you enter in that field. Unfortunately, I don't see how you could allow the skype protocol without manually editing that function in the core file wp-includes/formatting.php, which is always a bad idea.

if ( !is_array($protocols) )
    $protocols = array ('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'svn');
if ( wp_kses_bad_protocol( $url, $protocols ) != $url )
    return '';

Perhaps I've missed something though.

share|improve this answer
    
Hmm seems there is a filter, but it doesn't seem to work... apply_filters( 'kses_allowed_protocols', $protocols ) found that digging around wp_allowed_protocols() – addedlovely Jan 10 '12 at 1:37

You can make the skype: as an acceptable protocol by adding the following code in the functions.php file of your child theme or develop a small plugin and add it in that plugin file.

/**
 * Allows users to save skype protocol skype: in menu URL
 */
function vvd_allow_skype_protocol( $protocols ){
    $protocols[] = 'skype';
    return $protocols;
}
add_filter( 'kses_allowed_protocols' , 'vvd_allow_skype_protocol' );
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.