wp_password_change_notification()

wp_password_change_notification( WP_User $user ) 通知博客管理…

wp_password_change_notification( WP_User $user )

通知博客管理员用户更改密码,通常通过电子邮件。
Notify the blog admin of a user changing password, normally via email.

目录锚点:#参数#源码


参数(Parameters)

参数 类型 说明
$user (WP_User) 用户对象。

源码(Source)

/**
 * Notify the blog admin of a user changing password, normally via email.
 *
 * @since 2.7.0
 *
 * @param object $user User Object
 */
function wp_password_change_notification(&$user) {
	// send a copy of password change notification to the admin
	// but check to see if it's the admin whose password we're changing, and skip this
	if ( 0 !== strcasecmp( $user->user_email, get_option( 'admin_email' ) ) ) {
		$message = sprintf(__('Password Lost and Changed for user: %s'), $user->user_login) . "
";
		// The blogname option is escaped with esc_html on the way into the database in sanitize_option
		// we want to reverse this for the plain text arena of emails.
		$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
		wp_mail(get_option('admin_email'), sprintf(__('[%s] Password Lost/Changed'), $blogname), $message);
	}
}
endif;

if ( !function_exists('wp_new_user_notification') ) :
更新版本 源码位置 使用 被使用
2.7.0 wp-includes/pluggable.php 5 8
类别:WordPress 函数手册

本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。

评论 (0)COMMENT

登录 账号发表你的看法,还没有账号?立即免费 注册