添加管理员通知,提醒用户在更改电子邮件地址后检查确认请求电子邮件。

原型

new_user_email_admin_notice()

源文件

路径:wp-includes/user.php

<?php
...
function new_user_email_admin_notice() {
	global $pagenow;
	if ( 'profile.php' === $pagenow && isset( $_GET['updated'] ) && $email = get_user_meta( get_current_user_id(), '_new_email', true ) ) {
		/* translators: %s: New email address */
		echo '<div class="notice notice-info"><p>' . sprintf( __( 'Your email address has not been updated yet. Please check your inbox at %s for a confirmation email.' ), '<code>' . esc_html( $email['newemail'] ) . '</code>' ) . '</p></div>';
	}
}
...
?>

其他

英文文档:https://developer.wordpress.org/reference/functions/new_user_email_admin_notice/