Changeset 2764
- Timestamp:
- 02/22/2010 01:47:32 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.2/bp-forums/bp-forums-filters.php
r2659 r2764 35 35 add_filter( 'bp_get_forum_topic_count', 'bp_core_number_format' ); 36 36 37 add_filter( 'bp_get_the_topic_title', 'bp_forums_make_nofollow_filter' ); 38 add_filter( 'bp_get_the_topic_latest_post_excerpt', 'bp_forums_make_nofollow_filter' ); 39 add_filter( 'bp_get_the_topic_post_content', 'bp_forums_make_nofollow_filter' ); 37 40 38 41 function bp_forums_filter_kses( $content ) { … … 70 73 add_filter( 'bb_get_tag_link', 'bp_forums_filter_tag_link', 10, 4); 71 74 75 function 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 72 84 ?>
Note: See TracChangeset
for help on using the changeset viewer.