// Fields for redirect function custom_login_fields() { ?>
} // Redirect function function location_redirect() { $location = $_POST['login_location']; wp_safe_redirect($location); exit(); } // Add fields to the login form add_action('login_form','custom_login_fields'); // Make sure the redirect happens only if your fields are submitted if ( (isset($_GET['action']) && $_GET['action'] != 'logout') || (isset($_POST['login_location']) && !empty($_POST['login_location'])) ) add_filter('login_redirect', 'location_redirect', 10, 3); ?> 但我试了没成功,不知道原因出在何处。于是又找了下登录后返回登录前的页面(北京网站制作),有如下方法: