WordPress 常用函数 / make_clickable
将纯文本中的 URI 转换成 HTML 链接。
将转换 URI,www,FTP 和邮箱地址,并且修正链接中的链接。
<?php make_clickable( $text ) ?>
<?php make_clickable( $text ) ?>$text
(string) (required) 将转换成可点击的文本。
Default: None
(string)
链接转换成可点击的 HTML 代码。
$string = "Denis 的博客是 http://blog.wpjam.com/ ";
echo make_clickable($string);
$string = "Denis 的博客是 http://blog.wpjam.com/ ";
echo make_clickable($string);输出结果:
Denis 的博客是 <a href="http://blog.wpjam.com/" rel="nofollow">http://blog.wpjam.com/</a>
Since: 0.71
wp-includes/formatting.php