admin_created_user_email

函数
admin_created_user_email ( $text )
参数
  • (string) $text
    Required:
返回值
  • (string)
定义位置
相关方法
wpmu_create_userget_user_by_emailcreate_userwp_create_userwp_create_user_request
引入
-
弃用
-

admin_created_user_email: 当一个新的用户在WordPress管理区被创建时,这个钩子被触发。它传递用户的电子邮件地址作为参数。

function admin_created_user_email( $text ) {
	$roles = get_editable_roles();
	$role  = $roles[ $_REQUEST['role'] ];

	if ( '' !== get_bloginfo( 'name' ) ) {
		$site_title = wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES );
	} else {
		$site_title = parse_url( home_url(), PHP_URL_HOST );
	}

	return sprintf(
		/* translators: 1: Site title, 2: Site URL, 3: User role. */
		__(
			'Hi,
You've been invited to join '%1$s' at
%2$s with the role of %3$s.
If you do not want to join this site please ignore
this email. This invitation will expire in a few days.

Please click the following link to activate your user account:
%%s'
		),
		$site_title,
		home_url(),
		wp_specialchars_decode( translate_user_role( $role['name'] ) )
	);
}

常见问题

FAQs
查看更多 >