我需要清除从\\u author\\u meta(\'description\')返回的所有链接
我使用的代码很简单:
<p><?php the_author_meta(\'description\'); ?></p>
我搜索了那个老问题,但找不到正确的答案。。有什么想法吗?我需要清除从\\u author\\u meta(\'description\')返回的所有链接
我使用的代码很简单:
<p><?php the_author_meta(\'description\'); ?></p>
我搜索了那个老问题,但找不到正确的答案。。有什么想法吗?<?php
// grab description,
// note the "get_", we\'re not echoing the author meta, we\'re returning it
$user_description = get_the_author_meta(\'description\');
// removing all HTML tags:
echo strip_tags($user_description);
// removing all tags apart from paragraphs:
echo strip_tags($user_description,\'<p>\');
// removing just anchors (i.e. <a> tags):
echo preg_replace(array(\'{<a[^>]*>}\',\'{</a>}\'),array(\'\',\'\'),$user_description);
// removing all links including their text (i.e. <a href="...">...</a>):
echo preg_replace(\'{<a[^>]*>(.*?)</a>}\',\'\',$user_description);
?>
参考号:我的博客使用/?p=378 多年的permalink构造。这对Google Analytics没有多大帮助,我想把它改为YEAR/MONTH/DAY/post-title 结构有没有一种方法可以做到这一点而不丢失向后兼容性,以便旧的链接可以工作?