我想通过wordpress中的url传递一些值,但是我遇到了wordpress交换的一些问题&
to #038;
自动,如何制作&
仍然作为&
?
我注意到在wp-includes/formatting.php
,有很多交换符号的规则,我尝试修改一些代码,但失败了。
一些链接,例如
site.com?this=that&that=this
将输出到网络浏览器地址,例如site.com?this=that#038that=this
并且页面无法获取该部分的值that=this
如何正确设置?谢谢。
您可以禁用wptexturize() http://codex.wordpress.org/Function_Reference/wptexturize通过将其添加到函数.php文件位于模板文件夹中(或将其添加到现有文件夹中):
remove_filter('the_content', 'wptexturize');
但请注意,这当然会禁用所有“清理”,而不仅仅是“&”转换。
如果您只想摆脱 & 符号转换,您可以在formatting.php 中注释第 962 行。我在下面发布了第 961 和 962 行(这是来自未更改的 WP 3.1):
// Converts lone & characters into & (a.k.a. &)
$content = preg_replace('/&([^#])(?![a-z1-4]{1,8};)/i', '&$1', $content);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)