enable_maintenance_mode

过滤钩子


apply_filters( 'enable_maintenance_mode', true, $upgrading )
参数
  • (bool)
    $enable_checks
    Whether to enable maintenance mode. Default true.
    Required:
  • (int)
    $upgrading
    The timestamp set in the .maintenance file.
    Required:
定义位置
  • wp-includes/load.php
    , line 329
引入
4.6.0
弃用

过滤是否启用维护模式。

这个过滤器在被插件使用之前运行。它是为非网络运行时间设计的。如果这个过滤器返回true,维护模式将被激活,请求将结束。如果为false,即使维护模式处于激活状态,请求也将被允许继续处理。

if ( ! apply_filters( 'enable_maintenance_mode', true, $upgrading ) ) {