wp_rel_ugc( string $text )
Adds rel="nofollow ugc"
string to all HTML A elements in content.
Description Description
Parameters Parameters
- $text
-
(string) (Required) Content that may contain HTML A elements.
Return Return
(string) Converted content.
Source Source
File: wp-includes/formatting.php
function wp_rel_ugc( $text ) { // This is a pre-save filter, so text is already escaped. $text = stripslashes( $text ); $text = preg_replace_callback( '|<a (.+?)>|i', function( $matches ) { return wp_rel_callback( $matches, 'nofollow ugc' ); }, $text ); return wp_slash( $text ); }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
5.3.0 | Introduced. |