run_wptexturize
云策文档标注
概述
run_wptexturize 是一个 WordPress 过滤器,用于控制是否跳过执行 wptexturize() 函数。通过返回 false,可以绕过文本格式化处理,直接返回原始文本。
关键要点
- 过滤器 run_wptexturize 允许开发者决定是否运行 wptexturize() 函数。
- 返回 false 会短接 wptexturize(),直接返回传入的原始文本。
- 此过滤器仅在 wptexturize() 首次调用时运行一次。
- 相关函数 wptexturize() 用于将普通文本字符替换为格式化实体。
代码示例
add_filter('run_wptexturize', '__return_false');注意事项
此过滤器从 WordPress 4.0.0 版本引入,可用于全局禁用 wptexturize() 功能。
原文内容
Filters whether to skip running wptexturize() .
Description
Returning false from the filter will effectively short-circuit wptexturize() and return the original text passed to the function instead.
The filter runs only once, the first time wptexturize() is called.
See also
Parameters
$run_texturizebool-
Whether to short-circuit wptexturize() .
Source
$run_texturize = apply_filters( 'run_wptexturize', $run_texturize );
Changelog
| Version | Description |
|---|---|
| 4.0.0 | Introduced. |
Skip to note 2 content
pixeline
To disable entirely the curly replacement throughout your site, simply add to your functions.php :
add_filter('run_wptexturize', '__return_false');