钩子文档

wp_auth_check_load

💡 云策文档标注

概述

wp_auth_check_load 是一个 WordPress 过滤器,用于控制是否加载用户身份验证检查。通过返回 false 值,可以跳过加载过程。

关键要点

  • 这是一个过滤器,用于决定是否加载身份验证检查。
  • 返回 false 值可以阻止加载,实现短路效果。
  • 参数包括 $show(布尔值,表示是否加载)和 $screen(WP_Screen 对象,表示当前屏幕)。
  • 在 WordPress 3.6.0 版本中引入。

代码示例

if ( apply_filters( 'wp_auth_check_load', $show, $screen ) ) {
    // 加载身份验证检查的代码
}

注意事项

此过滤器主要用于监控用户是否仍保持登录状态,常用于后台管理界面。


📄 原文内容

Filters whether to load the authentication check.

Description

Returning a falsey value from the filter will effectively short-circuit loading the authentication check.

Parameters

$showbool
Whether to load the authentication check.
$screenWP_Screen
The current screen object.

Source

if ( apply_filters( 'wp_auth_check_load', $show, $screen ) ) {

Changelog

Version Description
3.6.0 Introduced.