通过在add\\u操作(“user\\u register”、“save\\u extra\\u profile\\u fields”)中添加此代码以保存\\u extra\\u profile\\u fields()来解决此问题;
$hash = md5( $random_number );
add_user_meta( $user_id, \'hash\', $hash );
$user_info = get_userdata($user_id);
$to = $user_info->user_email;
$subject = \'Member Verification\';
$message = \'Hello,\';
$message .= "\\n\\n";
$message .= \'Welcome...\';
$message .= "\\n\\n";
$message .= \'Username: \'.$un;
$message .= "\\n";
$message .= \'Password: \'.$pw;
$message .= "\\n\\n";
$message .= \'Please click this link to activate your account:\';
$message .= home_url(\'/\').\'activate?id=\'.$un.\'&key=\'.$hash;
$headers = \'From: [email protected]\' . "\\r\\n";
wp_mail($to, $subject, $message, $headers);