这是一个创建于 2414 天前的主题,其中的信息可能已经有所发展或是发生改变。
function autoicon($text) {
$return = str_replace('<a href=', '<a class="external" href=', $text);
$return = str_replace('<a class="external" href="#', '<a href="#', $return);
return $return;
}
add_filter('the_content', 'autoicon'); //应用于文章区域
上面这段代码 自动给链接加了一个样式 external 可是图片链接也给添加了
怎么排除图片链接?
求大神给修改一下 感谢!