返回介绍

wp_new_blog_notification()

发布于 2017-09-11 12:31:17 字数 2331 浏览 942 评论 0 收藏 0

wp_new_blog_notification( string $blog_title,  string $blog_url,  int $user_id,  string $password )

Notifies the site admin that the setup is complete.


description

Sends an email with wp_mail to the new administrator that the site setup is complete, and provides them with a record of their login credentials.


参数

$blog_title

(string) (Required) Site title.

$blog_url

(string) (Required) Site url.

$user_id

(int) (Required) User ID.

$password

(string) (Required) User's Password.


源代码

File: wp-admin/includes/upgrade.php

function wp_new_blog_notification($blog_title, $blog_url, $user_id, $password) {
	$user = new WP_User( $user_id );
	$email = $user->user_email;
	$name = $user->user_login;
	$login_url = wp_login_url();
	/* translators: New site notification email. 1: New site URL, 2: User login, 3: User password or password reset link, 4: Login URL */
	$message = sprintf( __( "Your new WordPress site has been successfully set up at:

%1\$s

You can log in to the administrator account with the following information:

Username: %2\$s
Password: %3\$s
Log in here: %4\$s

We hope you enjoy your new site. Thanks!

--The WordPress Team
https://wordpress.org/
"), $blog_url, $name, $password, $login_url );

	@wp_mail($email, __('New WordPress Site'), $message);
}

更新日志

Versiondescription
2.1.0Introduced.

相关函数

Uses

  • wp-includes/class-wp-user.php: WP_User::__construct()
  • wp-includes/l10n.php: __()
  • wp-includes/pluggable.php: wp_mail()
  • wp-includes/general-template.php: wp_login_url()

Used By

  • wp-admin/includes/upgrade.php: wp_install()

User Contributed Notes

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文