wp_rel_nofollow

函数


wp_rel_nofollow ( $text )
参数
  • (string)
    $text
    Content that may contain HTML A elements.
    Required:
返回值
  • (string) Converted content.
定义位置
  • wp-includes/formatting.php
    , line 3173
引入
1.5.0
弃用

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

function wp_rel_nofollow( $text ) {
	// This is a pre-save filter, so text is already escaped.
	$text = stripslashes( $text );
	$text = preg_replace_callback(
		'||i',
		static function( $matches ) {
			return wp_rel_callback( $matches, 'nofollow' );
		},
		$text
	);
	return wp_slash( $text );
}