WordPress的自作主张


WordPress总是自作主张的改变一些东西,根本就不经过你的同意。

我记得从前也有过WordPress自作主张的事情,好像是embed标签自动删除,导致无法插入flash视频,后来只能改代码,最近遇到的这个问题更变态了,它竟然把文章所有的英文符号全部变成中文的!它以为是帮助我,可惜只会给我添乱,我这么大人了连全角符号和半角符号都分不清楚,需要它来自动给我修改!

我几天看我曾经贴出来的代码,全部都不能用,后来我才发现,原来是符号的问题,我需要手动将所有的符号再次改为英文符号才可以,把我气的……

还好网上已经有高手解决了这个问题,其实也比较简单,就是在wp-includes 目录中的 formatting.php 文件中改一点代码,将:

if (isset($curl{0}) && ‘<’ != $curl{0} && ‘[' != $curl{0} && $next && !$has_pre_parent) { // If it's not a tag
// static strings
$curl = str_replace($static_characters, $static_replacements, $curl);
// regular expressions
$curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);
}

这一段代码改为

这里。


版权信息:本文来自老杨个人网站,作者老杨原文地址,转载请注明出处。

如果喜欢本站,敬请订阅:老杨个人网站。谢谢惠顾!


分类: 信息技术
标签: ,

前3排已经被占了我要占座

  1. 这么强啊,你还研究WP系统代码。

    回复Ta

    没有了,其实是别人写的代码

    回复Ta

  2. 我也改了下。。哈哈

    回复Ta

:emotion58 :emotion57 :emotion563 :emotion562 :emotion561 :emotion560 :emotion56 :emotion559 :emotion558 :emotion557 :emotion556 :emotion554 :emotion552 :emotion551 :emotion550 :emotion55 :emotion547 :emotion546 :emotion544 :emotion543 :emotion542 :emotion541 :emotion540 :emotion54 :emotion539 :emotion538 :emotion537 :emotion536 :emotion535 :emotion534 :emotion533 :emotion532 :emotion531 :emotion530 :emotion53 :emotion529 :emotion526 :emotion525 :emotion524 :emotion523 :emotion522 :emotion521 :emotion520 :emotion52 :emotion519 :emotion518 :emotion517 :emotion516 :emotion515 :emotion514 :emotion513 :emotion512 :emotion511 :emotion510 :emotion51 :emotion119 :emotion113