wp_rel_nofollow

Adds rel nofollow string to all HTML A elements in content.

Description

(string) wp_rel_nofollow( (string) $text ); 

Returns (string)

Converted content.

Parameters (1)

0. $text (string)
Content that may contain HTML A elements.

Usage

  1. if ( !function_exists( 'wp_rel_nofollow' ) ) { 
  2. require_once ABSPATH . WPINC . '/formatting.php'; 
  3.  
  4. // Content that may contain HTML A elements. 
  5. $text = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wp_rel_nofollow($text); 
  9.  

Defined (1)

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

/wp-includes/formatting.php  
  1. function wp_rel_nofollow( $text ) { 
  2. // This is a pre save filter, so text is already escaped. 
  3. $text = stripslashes($text); 
  4. $text = preg_replace_callback('|<a (.+?)>|i', 'wp_rel_nofollow_callback', $text); 
  5. return wp_slash( $text );