钩子文档

enable_edit_any_user_configuration

💡 云策文档标注

概述

enable_edit_any_user_configuration 是一个 WordPress 过滤器,用于控制多站点网络中管理员是否能够编辑所有用户。它替代了旧的 EDIT_ANY_USER 常量,并依赖于用户权限和登录状态。

关键要点

  • 这是一个过滤器,允许开发者调整多站点管理员编辑任何用户的权限。
  • 启用此过滤器还需用户具备 'manage_network_users' 能力,且登录用户不能与正在编辑的用户相同。
  • 该过滤器在 WordPress 3.0.0 版本中引入,取代了 EDIT_ANY_USER 常量。
  • 参数 $allow 是一个布尔值,默认为 true,表示允许编辑任何用户。

代码示例

&& ! apply_filters( 'enable_edit_any_user_configuration', true )

📄 原文内容

Filters whether to allow administrators on Multisite to edit every user.

Description

Enabling the user editing form via this filter also hinges on the user holding the ‘manage_network_users’ cap, and the logged-in user not matching the user profile open for editing.

The filter was introduced to replace the EDIT_ANY_USER constant.

Parameters

$allowbool
Whether to allow editing of any user. Default true.

Source

&& ! apply_filters( 'enable_edit_any_user_configuration', true )

Changelog

Version Description
3.0.0 Introduced.