用户注册后可以使用简单重定向。如果表单没有使用Javascript ajax,可以将其与注册函数一起使用(示例);
$new_user = wp_insert_user(array(
\'user_login\' => $user_login,
\'user_pass\' => $user_pass,
\'user_email\' => $user_email,
\'first_name\' => $user_first,
\'last_name\' => $user_last,
\'user_registered\' => date(\'Y-m-d H:i:s\'),
\'role\' => \'subscriber\'
)
);
if($new_user) {
// Maybe you have some custom user metas
update_user_meta($new_user,\'customarea\',\'custom value\');
// log the new user in
wp_setcookie($user_login, $user_pass, true);
wp_set_current_user($new_user_id, $user_login);
do_action(\'wp_login\', $user_login);
// send the newly created user to the home page after logging them in
wp_redirect(home_url()); exit;
}