wp_rel_nofollow() WordPress Function
The wp_rel_nofollow() function is a utility function for use in rel="nofollow" attribute generation. It is typically called by other functions that generate links with the nofollow attribute.
wp_rel_nofollow( string $text ) #
Adds rel="nofollow"
string to all HTML A elements in content.
Parameters
- $text
(string)(Required)Content that may contain HTML A elements.
Return
(string) Converted content.
Source
File: 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', static function( $matches ) { return wp_rel_callback( $matches, 'nofollow' ); }, $text ); return wp_slash( $text ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
1.5.0 | Introduced. |