Skip to content

Commit

Permalink
Merge pull request #109 from tvartom/master
Browse files Browse the repository at this point in the history
Redirect on renamed login page when logged in
  • Loading branch information
Arsenal21 authored Mar 31, 2021
2 parents 7126f71 + 422a4bd commit 9316034
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,16 @@ function qtranxf_init_language() {}
|| (!get_option('permalink_structure') && isset($_GET[$login_slug]))){
if(empty($action) && is_user_logged_in()){
//if user is already logged in but tries to access the renamed login page, send them to the dashboard
AIOWPSecurity_Utility::redirect_to_url(AIOWPSEC_WP_URL."/wp-admin");
// or to requested redirect-page, filterd in 'login_redirect'.
if (isset($_REQUEST['redirect_to'])) {
$redirect_to = $_REQUEST['redirect_to'];
$requested_redirect_to = $redirect_to;
} else {
$redirect_to = admin_url();
$requested_redirect_to = '';
}
$redirect_to = apply_filters('login_redirect', $redirect_to, $requested_redirect_to, wp_get_current_user());
AIOWPSecurity_Utility::redirect_to_url($redirect_to);
}else{
global $wp_version;
do_action('aiowps_rename_login_load');
Expand Down Expand Up @@ -249,4 +258,4 @@ static function aiowps_set_404()
die;
}

}
}

0 comments on commit 9316034

Please sign in to comment.