From e6e4d8d8697c99efd4c8e0b72914ba669981ac58 Mon Sep 17 00:00:00 2001 From: Paul Ryan Date: Mon, 1 Nov 2021 11:15:33 -1000 Subject: [PATCH] Redirect to home page after logging in if using custom login url with WPS Hide Login plugin #103 --- src/authorizer/class-helper.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/authorizer/class-helper.php b/src/authorizer/class-helper.php index 52ef422f..7971ca24 100644 --- a/src/authorizer/class-helper.php +++ b/src/authorizer/class-helper.php @@ -508,6 +508,13 @@ public static function modify_current_url_for_external_login( $provider = 'cas' $url = wp_login_url( $url ); } + // Edge case: If the WPS Hide Login plugin is installed, redirect to home + // page after logging in instead of the plugin's login endpoint, which will + // redirect to /wp-admin. + if ( class_exists( '\WPS\WPS_Hide_Login\Plugin' ) ) { + $url = wp_login_url( home_url() ); + } + // Parse the URL into its components. $parsed_url = wp_parse_url( $url );