got_rewrite
云策文档标注
概述
got_rewrite 是一个 WordPress 过滤器,用于判断 Apache 和 mod_rewrite 是否存在。此过滤器已过时,建议使用 got_url_rewrite 过滤器替代。
关键要点
- 过滤器名称:got_rewrite
- 参数:$got_rewrite(布尔值),表示 Apache 和 mod_rewrite 是否存在
- 替代方案:使用 got_url_rewrite 过滤器,通过 got_url_rewrite() 函数调用
- 相关函数:got_mod_rewrite() 用于检查服务器是否运行 Apache 并加载了 mod_rewrite 模块
- 引入版本:WordPress 2.5.0
注意事项
此过滤器已过时,不应在新代码中使用,以避免兼容性问题。
原文内容
Filters whether Apache and mod_rewrite are present.
Description
This filter was previously used to force URL rewriting for other servers, like nginx. Use the ‘got_url_rewrite’ filter in got_url_rewrite() instead.
See also
Parameters
$got_rewritebool-
Whether Apache and mod_rewrite are present.
Source
return apply_filters( 'got_rewrite', $got_rewrite );
Changelog
| Version | Description |
|---|---|
| 2.5.0 | Introduced. |