钩子文档

automatic_updater_disabled

💡 云策文档标注

概述

本文档介绍 WordPress 的 automatic_updater_disabled 过滤器,用于控制是否完全禁用后台自动更新。该过滤器与 AUTOMATIC_UPDATER_DISABLED 常量功能类似,并会影响更新通知邮件的发送。

关键要点

  • 过滤器名称:automatic_updater_disabled
  • 参数:$disabled(布尔值),表示是否禁用更新器
  • 作用:完全禁用后台自动更新,包括更新通知邮件
  • 相关函数:WP_Site_Health_Auto_Updates::test_filters_automatic_updater_disabled() 和 WP_Automatic_Updater::is_disabled()
  • 引入版本:WordPress 3.7.0

代码示例

return apply_filters( 'automatic_updater_disabled', $disabled );

注意事项

  • 此过滤器用于全局禁用,如需选择性禁用,应使用更细粒度的过滤器
  • 禁用后可能影响更新通知邮件,未来行为可能变更

📄 原文内容

Filters whether to entirely disable background updates.

Description

There are more fine-grained filters and controls for selective disabling.
This filter parallels the AUTOMATIC_UPDATER_DISABLED constant in name.

This also disables update notification emails. That may change in the future.

Parameters

$disabledbool
Whether the updater should be disabled.

Source

return apply_filters( 'automatic_updater_disabled', $disabled );

Changelog

Version Description
3.7.0 Introduced.