中文 WordPress 系统会自动将半角标点符号转换为全角,带来的不便有二点:一是,英文中出现全角标点影响美观;二是,代码中的标点被换成全角后,根本就无法运行了,而且还很难查出错误的所在。
按下面的方法,修改 WordPress 程序,可以关闭此自动转换功能。打开 wp-includes/formatting.php 文件,找到下面二条语句:
$curl = str_replace($static_characters, $static_replacements, $curl);
$curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);
$curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);
注释掉,即可:
//$curl = str_replace($static_characters, $static_replacements, $curl);
//$curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);
//$curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);
另外,也可以使用外部插件 Quotmarks Replacer 来关闭此替换功能。
No comments:
Post a Comment