禁止wordpress自动将半角转换为全角 禁止全角和半角的转换

发布文章时WordPress会自动将代码中的单双引号转换为全角符号,分享代码特别不方便,解决方法如下

找到wp-includes/formatting.php文件中

复制代码
代码如下:

// This is not a tag, nor is the texturization disabled static strings
$curl = str_replace($static_characters, $static_replacements, $curl);
//regular expressions
$curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);

将两行替换函数代码加上注释,在前面加上 //


复制代码
代码如下:

// This is not a tag, nor is the texturization disabled static strings
// $curl = str_replace($static_characters, $static_replacements, $curl);
// regular expressions
// $curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);

以上就是禁止wordpress自动将半角转换为全角 禁止全角和半角的转换的详细内容,更多请关注0133技术站其它相关文章!

赞(0) 打赏
未经允许不得转载:0133技术站首页 » CMS教程