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
if ( !function_exists( 'wp_rel_nofollow' ) ) { require_once ABSPATH . WPINC . '/formatting.php'; } // Content that may contain HTML A elements. $text = ''; // NOTICE! Understand what this does before running. $result = wp_rel_nofollow($text);
Defined (1)
The function is defined in the following location(s).
- /wp-includes/formatting.php
- function wp_rel_nofollow( $text ) {
- // This is a pre save filter, so text is already escaped.
- $text = stripslashes($text);
- $text = preg_replace_callback('|<a (.+?)>|i', 'wp_rel_nofollow_callback', $text);
- return wp_slash( $text );
- }