钩子文档

remove_user_from_blog

💡 云策文档标注

概述

remove_user_from_blog 是一个 WordPress Hook,在用户从站点移除前触发,允许开发者执行自定义操作。

关键要点

  • 触发时机:在用户被从站点移除之前执行。
  • 参数:$user_id(用户ID)、$blog_id(站点ID)、$reassign(文章重新分配的用户ID)。
  • 相关函数:与 remove_user_from_blog() 函数关联,用于从博客移除用户。
  • 版本历史:自 WordPress MU 3.0.0 引入,5.4.0 版本中正式添加。

📄 原文内容

Fires before a user is removed from a site.

Parameters

$user_idint
ID of the user being removed.
$blog_idint
ID of the blog the user is being removed from.
$reassignint
ID of the user to whom to reassign posts.

Source

do_action( 'remove_user_from_blog', $user_id, $blog_id, $reassign );

Changelog

Version Description
MU (3.0.0) MU (3.0.0)
5.4.0 Introduced.