users_have_additional_content
云策文档标注
概述
此文档介绍 WordPress 中的 users_have_additional_content 过滤器,用于在删除用户时检查是否存在除 post_author 和 link_owner 关系外的额外关联内容。
关键要点
- 过滤器名称:users_have_additional_content
- 参数:$users_have_additional_content(布尔值,默认 false)和 $user_ids(整数数组,表示被删除用户的 ID)
- 用途:允许开发者自定义判断用户是否有额外内容,影响用户删除操作
- 引入版本:WordPress 5.2.0
代码示例
$users_have_content = (bool) apply_filters( 'users_have_additional_content', false, $user_ids );
原文内容
Filters whether the users being deleted have additional content associated with them outside of the post_author and link_owner relationships.
Parameters
$users_have_additional_contentbool-
Whether the users have additional content. Default false.
$user_idsint[]-
Array of IDs for users being deleted.
Source
$users_have_content = (bool) apply_filters( 'users_have_additional_content', false, $user_ids );
Changelog
| Version | Description |
|---|---|
| 5.2.0 | Introduced. |