Skip to:
Content

BuddyPress.org

Changeset 2764


Ignore:
Timestamp:
02/22/2010 01:47:32 PM (14 years ago)
Author:
apeatling
Message:

Fixes #2011

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-forums/bp-forums-filters.php

    r2659 r2764  
    3535add_filter( 'bp_get_forum_topic_count', 'bp_core_number_format' );
    3636
     37add_filter( 'bp_get_the_topic_title', 'bp_forums_make_nofollow_filter' );
     38add_filter( 'bp_get_the_topic_latest_post_excerpt', 'bp_forums_make_nofollow_filter' );
     39add_filter( 'bp_get_the_topic_post_content', 'bp_forums_make_nofollow_filter' );
    3740
    3841function bp_forums_filter_kses( $content ) {
     
    7073add_filter( 'bb_get_tag_link', 'bp_forums_filter_tag_link', 10, 4);
    7174
     75function bp_forums_make_nofollow_filter( $text ) {
     76    return preg_replace_callback( '|<a (.+?)>|i', 'bp_forums_make_nofollow_filter_callback', $text );
     77}
     78    function bp_forums_make_nofollow_filter_callback( $matches ) {
     79        $text = $matches[1];
     80        $text = str_replace( array( ' rel="nofollow"', " rel='nofollow'"), '', $text );
     81        return "<a $text rel=\"nofollow\">";
     82    }
     83
    7284?>
Note: See TracChangeset for help on using the changeset viewer.