WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Adding “mms://” links to the sidebar

[Resolved] Adding “mms://” links to the sidebar

  • Hi, I am a newbie to WP, and a very amatuerish (I am just hearning PHP/HTML, and I have a problem that is stumping me.

    I want to be able to add “streaming radio” links to my sidebar (prefixed with mms:// instead of http://).

    I found what I THOUGHT was the fix in /wp-includes/ (“kses.php”, line 42), which is;

    function wp_kses($string, $allowed_html, $allowed_protocols = array (‘mms’, ‘http’, ‘https’, ‘ftp’, ‘news’, ‘nntp’, ‘telnet’, ‘feed’, ‘gopher’, ‘mailto’))

    This did not solve the problem. My mms:// links are all being prefixed wit http:// (ie. http://mms://radioportal.com).

    Someone please help me.

    Regards,

    M3g4d37h

    PS – To see the errors, go to my site at http://www.m3g4d37h.net, and look at the internet radio links in the sidebar.

Viewing 2 replies - 1 through 2 (of 2 total)
  • What you’re looking to change is a line in the edit_link() function (wp-admin/admin-functions.php). Around line 472 look for:

    $_POST['link_url'] = preg_match('/^(https?|ftps?|mailto|news|gopher):/is', $_POST['link_url']) ? $_POST['link_url'] : 'http://' . $_POST['link_url'];

    And add the protocol there:

    $_POST['link_url'] = preg_match('/^(https?|ftps?|mailto|news|gopher|mms):/is', $_POST['link_url']) ? $_POST['link_url'] : 'http://' . $_POST['link_url'];

    Source hacking note: Back up files before editing them, and comment your changes for future reference.

    Thanks very much big guy. 🙂

    Worked like a charm!

    Regards,

    M3g4d37h

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Adding “mms://” links to the sidebar’ is closed to new replies.
Skip to toolbar