WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Adding "mms://" links to the sidebar (3 posts)

  1. m3g4d37h
    Member
    Posted 8 years ago #

    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.

  2. Kafkaesqui

    Posted 8 years ago #

    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.

  3. m3g4d37h
    Member
    Posted 8 years ago #

    Thanks very much big guy. :-)

    Worked like a charm!

    Regards,

    M3g4d37h

Topic Closed

This topic has been closed to new replies.

About this Topic