bp_activity_make_nofollow_filter

Catch links in activity text so rel=nofollow can be added.

Description

(string) bp_activity_make_nofollow_filter( (string) $text ); 

Returns (string)

$text Text with rel=nofollow added to any links.

Parameters (1)

0. $text (string)
Activity text.

Usage

  1. if ( !function_exists( 'bp_activity_make_nofollow_filter' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-activity/bp-activity-filters.php'; 
  3.  
  4. // Activity text. 
  5. $text = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_activity_make_nofollow_filter($text); 
  9.  

Defined (1)

The function is defined in the following location(s).

/bp-activity/bp-activity-filters.php  
  1. function bp_activity_make_nofollow_filter( $text ) { 
  2. return preg_replace_callback( '|<a (.+?)>|i', 'bp_activity_make_nofollow_filter_callback', $text );