如何批量替换或者删除wordpress文章中的文字
1、在WordPress主题 的 functions.php 文件中添加如下代码:
2、function replace_text_xintheme($text){
$replace = array(
//'关键词' => '将要替换的关键词'
'例子' => '案例',
'WordPress' => 'WordPress主题',
);
$text = str_replace(array_keys($replace), $replace, $text);
return $text;
}
add_filter('the_content', 'replace_text_xintheme');
add_filter('the_excerpt', 'replace_text_xintheme');
3、按照上面的方法就可以了,是不是很简单快速呢?
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:62
阅读量:51
阅读量:83
阅读量:160
阅读量:60