Hook update_option_new_admin_email to add_option_new_admin_email so that the confirmation email gets set even when new_admin_email doesn't already exist. see #12192

git-svn-id: http://svn.automattic.com/wordpress/trunk@14242 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-04-26 18:20:11 +00:00
parent 372ff2e83a
commit b7543c5352

View File

@ -273,9 +273,12 @@ function wpmu_get_blog_allowedthemes( $blog_id = 0 ) {
} }
function update_option_new_admin_email( $old_value, $value ) { function update_option_new_admin_email( $old_value, $value ) {
error_log(var_export($value, true));
$email = get_option( 'admin_email' );
error_log(var_export($email, true));
if ( $value == get_option( 'admin_email' ) || !is_email( $value ) ) if ( $value == get_option( 'admin_email' ) || !is_email( $value ) )
return; return;
error_log('here');
$hash = md5( $value. time() .mt_rand() ); $hash = md5( $value. time() .mt_rand() );
$new_admin_email = array( $new_admin_email = array(
'hash' => $hash, 'hash' => $hash,
@ -307,6 +310,7 @@ All at ###SITENAME###
wp_mail( $value, sprintf( __( '[%s] New Admin Email Address' ), get_option( 'blogname' ) ), $content ); wp_mail( $value, sprintf( __( '[%s] New Admin Email Address' ), get_option( 'blogname' ) ), $content );
} }
add_action( 'update_option_new_admin_email', 'update_option_new_admin_email', 10, 2 ); add_action( 'update_option_new_admin_email', 'update_option_new_admin_email', 10, 2 );
add_action( 'add_option_new_admin_email', 'update_option_new_admin_email', 10, 2 );
function send_confirmation_on_profile_email() { function send_confirmation_on_profile_email() {
global $errors, $wpdb, $current_user; global $errors, $wpdb, $current_user;