wp_password_change_notification()发送一个密码修改提醒邮件给用户

目录

描述

Notify the blog admin of a user changing password, normally via email. This function is normally called when a user resets a lost password, not if the password is changed on their profile page.

This function can be replaced via plugins. If plugins do not redefine these functions, then this will be used instead.

wp_password_change_notification() 描述

用法

<?php wp_password_change_notification$user ?>

wp_password_change_notification() 用法

参数

$user

(object) (必填) User Object

默认值: None

wp_password_change_notification() 参数

返回值

(void) 

This function does not return a value.

wp_password_change_notification() 返回值

历史

  • 添加于 版本: 2.7

wp_password_change_notification() 历史

源文件

wp_password_change_notification() 函数的代码位于 wp-includes/pluggable.php

/* ----------------------------------
 * wordpress之魂 © http://wphun.com
 * ---------------------------------- */
/**
 * 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') ) :

wp_password_change_notification() 源文件

相关