confirm_user_signup()
概述
confirm_user_signup() 是一个 WordPress 函数,用于在用户注册后显示确认消息,提示用户已注册但需要激活。
关键要点
- 函数作用:显示新用户注册确认消息,告知用户账户正在等待激活。
- 参数:接受两个必需参数:$user_name(用户名,字符串类型)和 $user_email(用户邮箱,字符串类型)。
- 相关 Hook:do_action('signup_finished'),在站点或用户注册过程完成时触发。
- 相关函数:与 validate_user_signup() 配合使用,用于验证新用户注册。
- 版本历史:自 WordPress MU 3.0.0 版本引入。
Shows a message confirming that the new user has been registered and is awaiting activation.
Parameters
$user_namestringrequired-
The username.
$user_emailstringrequired-
The user’s email address.
Source
function confirm_user_signup( $user_name, $user_email ) {
?>
<h2>
</h2>
<p>you must activate it</strong>.' ); ?></p>
<p>
' . $user_email . '</strong>' );
?>
</p>
<p></p>
</pre><p class="wporg-dot-link-list"><a href="https://developer.wordpress.org/reference/files/wp-signup.php/">View all references</a> <a href="https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-signup.php#L703">View on Trac</a> <a href="https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-signup.php#L703-L722">View on GitHub</a></p></section>
<section class="wp-block-wporg-code-reference-hooks"><h2 id="hooks" class="is-toc-heading wp-block-heading has-heading-5-font-size" tabindex="-1" ><a href="#hooks">Hooks</a></h2> <dl><dt class="wp-block-wporg-code-reference-title has-normal-font-size"><a href="https://developer.wordpress.org/reference/hooks/signup_finished/"><span class="hook-func">do_action</span>( ‘signup_finished’ )</a></dt><dd><p>Fires when the site or user sign-up process is complete.</p>
</dd></dl></section>
<section class="wp-block-wporg-code-reference-related" data-nosnippet="true"><h2 id="related" class="is-toc-heading wp-block-heading has-heading-5-font-size" tabindex="-1" ><a href="#related">Related</a></h2> <section style="margin-top:var(--wp--preset--spacing--20)" class="wp-block-wporg-code-table" id="uses"><figure class="wp-block-table "><table><thead><tr><th scope="col">Uses</th><th scope="col">Description</th></tr></thead><tbody><tr class=""><td><a href="https://developer.wordpress.org/reference/functions/__/">__()</a><code>wp-includes/l10n.php
Retrieves the translation of $text.
_e()wp-includes/l10n.php
Displays translated text.
do_action()wp-includes/plugin.php
Calls the callback functions that have been added to an action hook.
| Used by | Description |
|---|---|
validate_user_signup()wp-signup.php |
Validates the new user sign-up. |
Changelog
| Version | Description |
|---|---|
| MU (3.0.0) | Introduced. |