钩子文档

signup_hidden_fields

💡 云策文档标注

概述

signup_hidden_fields 是一个 WordPress Hook,在创建另一个站点或用户时,当隐藏的注册表单字段输出时触发。它允许开发者在注册流程的特定步骤中注入自定义代码。

关键要点

  • 这是一个 Action Hook,用于在注册表单输出隐藏字段时执行自定义操作。
  • 参数 $context 是一个字符串,描述注册流程的步骤,可能值为 'create-another-site'、'validate-user' 或 'validate-site'。
  • Hook 在 WordPress MU 3.0.0 版本中引入,常用于多站点环境。
  • 相关函数包括 signup_another_blog()、signup_user() 和 signup_blog(),这些函数在 wp-signup.php 文件中定义,用于显示不同类型的注册表单。

代码示例

do_action( 'signup_hidden_fields', 'create-another-site' );

📄 原文内容

Fires when hidden sign-up form fields output when creating another site or user.

Parameters

$contextstring
A string describing the steps of the sign-up process. The value can be 'create-another-site', 'validate-user', or 'validate-site'.

Source

do_action( 'signup_hidden_fields', 'create-another-site' );

Changelog

Version Description
MU (3.0.0) Introduced.