Skip to:
Content
Pages
Categories
Search
Top
Bottom

Open links in new tab


  • ChocolateTeapot
    Participant

    @chocolateteapot

    WordPress Version 5.7.2
    BuddyPress Version 7.3.0

    I need to open links in BuddyPress posts and comments in a new tab.

    I’ve installed Code Snippet and I’m using this function, but it isn’t working.

    function altlab_special_links_activity( $body ) { 
         $body = str_replace(' rel="nofollow"',' rel="nofollow" target="_blank"',$body);
    
        return $body; 
    
    }
    add_filter( 'bp_get_activity_content_body', 'altlab_special_links_activity', 15, 1 );
    

    Any help would be gratefully received, thanks.

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