pre_wp_update_https_detection_errors
云策文档标注
概述
pre_wp_update_https_detection_errors 是一个 WordPress 过滤器,用于在检测 HTTPS 支持错误时短路默认逻辑。该过滤器在 6.4.0 版本中已弃用,被 pre_wp_get_https_detection_errors 替代。
关键要点
- 过滤器允许通过返回 WP_Error 对象来短路 HTTPS 检测的默认远程请求过程。
- 参数 $pre 可为 null 或 WP_Error,null 表示继续默认行为,WP_Error 则存储其错误数组。
- 该过滤器在 WordPress 6.4.0 中弃用,建议使用 pre_wp_get_https_detection_errors 替代。
代码示例
$support_errors = apply_filters( 'pre_wp_update_https_detection_errors', null );注意事项
- 过滤器主要用于 wp_update_https_detection_errors() 函数,该函数已弃用。
- 开发者应更新代码以使用新的过滤器 pre_wp_get_https_detection_errors,以确保兼容性。
原文内容
Short-circuits the process of detecting errors related to HTTPS support.
Description
Returning a WP_Error from the filter will effectively short-circuit the default logic of trying a remote request to the site over HTTPS, storing the errors array from the returned WP_Error instead.
Parameters
$prenull|WP_Error-
Error object to short-circuit detection, or null to continue with the default behavior.
Source
$support_errors = apply_filters( 'pre_wp_update_https_detection_errors', null );