将rel nofollow字符串添加到内容中的所有HTML A元素。
原型
wp_rel_nofollow( string $text )
参数
$text
(string)
(Required)
可能包含HTML A元素的内容。
返回值
(string)
转换内容。
源文件
路径:wp-includes/formatting.php
<?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 );
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/wp_rel_nofollow/