Skip to:
Content
Pages
Categories
Search
Top
Bottom

target=blank for external links in forum

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

  • B
    Participant

    @piksel

    No one? Someone must’ve implemented this for bbPress 2.x by now.


    Robin W
    Moderator

    @robin-w

    Bumping you own question may be not helping you in getting an answer πŸ™‚

    There is a fairly small group of people who help on here, and many use the “topics with no replies” button when logging in, so by entering a reply you take yourself off this list, so you don’t get your question seen.

    Also you should allow at least a couple of days, as all the helpers on here are volunteers and like the developers of the plugin, no-one is paid to do this, and all have real jobs and family that take priority.

    Please keep asking questions, but please have a little more patience πŸ™‚

    As to the answer – this looks complicated, and even with the old version, the solutions weren’t easy.


    B
    Participant

    @piksel

    @robin-w thanks, and apologies if that came off as angry or impatient. certainly wasn’t meant that way. should’ve added a few smilies πŸ™‚

    I just had a quick look and I’d say the following thread has some tips and suggestions.

    https://wordpress.org/ideas/topic/default-links-to-open-in-new-window-ie-target-_blank

    I am also of the belief that target=_blank is not a good thing at all, I’ll happily call out people using it and not return to their site because they use it, and I know I am far from the only person with this opinion.


    Stagger Lee
    Participant

    @stagger-lee

    I do it with this snippet. For WordPress and bbPress together. Local links are opened normally, only extern are target blank. Dont forget to change your domain line.

    // Make URL Clickable In WordPress, bbPress (plus target=”_blank”)
    add_filter( 'the_content', 'make_clickable');
    
    function autoblank($text) {
    $myurl = 'http://your-domain.com';
    $external = str_replace('href=', 'target="_blank" href=', $text);
    $external = str_replace('target="_blank" href="'.$myurl, 'href="'.$myurl, $external);
    $external = str_replace('target="_blank" href="#', 'href="#', $external);
    $external = str_replace('target = "_blank">', '>', $external);
    return $external;
    }
    add_filter('the_content', 'autoblank');
    add_filter('bbp_get_topic_content', 'autoblank',255);
    add_filter('bbp_get_reply_content', 'autoblank',255);

    Remove nofollow if you need to !

    function mtn_weekly_fix_rel_follow( $content ) {
        // Find rel="nofollow", replace with empty space.
        $content = preg_replace( '/rel="nofollow"/', ' ', $content);
        return $content;
    }
    add_filter( 'the_content', 'mtn_weekly_fix_rel_follow', 20 );
    add_filter('bbp_get_topic_content', 'mtn_weekly_fix_rel_follow',255);
    add_filter('bbp_get_reply_content', 'mtn_weekly_fix_rel_follow',255);
    

    laddi
    Participant

    @laddi

    Hello, I want to keep links simple not clickable, even after using remove_filter make_clickable, I am unable to do this, please help.


    Stagger Lee
    Participant

    @stagger-lee

    remove_filter( 'bbp_get_reply_content', 'bbp_make_clickable', 4);
    remove_filter( 'bbp_get_topic_content', 'bbp_make_clickable', 4); 

    gimmiefreebies
    Participant

    @gimmiefreebies

    I had this problem and there seems to be no easy answer – until I tried a different browser (!!)

    In Firefox, the LINK button does not look the same as it does in CHROME!! In Google Chrome’s web browser you can check a box under the link title and the link will OPEN IN A NEW WINDOW! πŸ™‚ That checkbox is not visible in Firefox.

    If you’re running the latest version of bbPress (right now it’s Version 2.5.4), that should work!

    Chrome:
    screen shot

    Firefox:
    screen shot

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