Skip to:
Content
Pages
Categories
Search
Top
Bottom

Custom URL schemes for anonymous users


  • PittNZK
    Participant

    @pittnzk

    I’m currently developing an iOS app along with a WordPress site with the bbPress plugin.

    I would like to allow any user to easily post links with custom schemes in the forum like :

    myappname://badebidobudy/fdjlkqsfj

    I saw that in bbPress an admin can indeed post a link and its href is not interpreted so it remains :

    href=”myappname://badebidobudy/fdjlkqsfj”

    and bbPress tells me why :

    > Your account has the ability to post unrestricted HTML content.

    But when an anonymous user wants to do this, the custom scheme is removed and the resulting a tag href is :

    href=”//badebidobudy/fdjlkqsfj”

    So my question is : how can I configure (or tweak) WordPress or bbPress to at least accept my url scheme or even recognize a raw link with a custom scheme ?

Viewing 3 replies - 1 through 3 (of 3 total)

  • PittNZK
    Participant

    @pittnzk

    Just removed the tags above so that my question makes sense 🙂


    PittNZK
    Participant

    @pittnzk

    Ok, I figured it out.
    Just wrote a small plugin adding the “newzik” protocol :

    <?php
    /**
    * Plugin Name: NZK links support
    * Plugin URI: http://newzik.com/
    * Description: Adds support to newzik:// links
    * Version: 1.0
    * Author: Pierre Mardon
    * Author URI: http://newzik.com/
    * License: None
    */
    
    /**
     * Extend list of allowed protocols.
     *
     * @param array $protocols List of default protocols allowed by WordPress.
     *
     * @return array $protocols Updated list including new protocols.
     */
    function wporg_extend_allowed_protocols( $protocols ){
        $protocols[] = 'newzik';
        return $protocols;
    }
    add_filter( 'kses_allowed_protocols' , 'wporg_extend_allowed_protocols' );
    ?>

    Robkk
    Moderator

    @robkk

    Glad you resolved your own issue, and also glad you shared your fix!! 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar