钩子文档

set_current_user

💡 云策文档标注

概述

set_current_user 是一个 WordPress 动作钩子,在设置当前用户后触发,用于在用户身份变更时执行自定义代码。

关键要点

  • 这是一个动作钩子,通过 do_action('set_current_user') 调用。
  • 在 wp_set_current_user() 函数中触发,用于更改当前用户。
  • 自 WordPress 2.0.1 版本引入。

📄 原文内容

Fires after the current user is set.

Source

do_action( 'set_current_user' );

Changelog

Version Description
2.0.1 Introduced.