Skip to content

Commit 6fd0341

Browse files
committed
Add Support for WPS Hide Login
Detect whether WPS Hide Plugin is installed and enabled. If so, make sure the hidden URL is used instead of wp-login.php in SAML Login URL.
1 parent fb75edc commit 6fd0341

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

onelogin-saml-sso/php/functions.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,12 @@ function saml_custom_login_footer() {
104104
$saml_login_message = "SAML Login";
105105
}
106106

107-
echo '<div style="font-size: 110%;padding:8px;background: #fff;text-align: center;"><a href="'.esc_url( get_site_url().'/wp-login.php?saml_sso') .'">'.esc_html($saml_login_message).'</a></div>';
107+
$login_page = 'wp-login.php';
108+
if (is_plugin_active('wps-hide-login/wps-hide-login.php')) {
109+
$login_page = str_replace( 'wp-login.php', get_site_option( 'whl_page', 'login' ), $login_page ) . '/';
110+
}
111+
112+
echo '<div style="font-size: 110%;padding:8px;background: #fff;text-align: center;"><a href="'.esc_url( get_site_url().'/'.$login_page.'?saml_sso') .'">'.esc_html($saml_login_message).'</a></div>';
108113
}
109114

110115
function saml_load_translations() {

0 commit comments

Comments
 (0)