When the plugin is on, the is_login() function does not work.
-
A new function named is_login() has been added after version 6.1 of wordpress.
https://developer.www.ads-software.com/reference/functions/is_login/It is located at wp-includes/load.php:1152 as shown above, and the source code is
return false ! == stripos( wp_login_url(), $_SERVER[‘SCRIPT_NAME’] );When the plugin is on, is_login() does not work. It cannot properly determine if the user is on the login page.
I looked at the source code output of is_login() and found the following problem.
The function “wp_login_url()” works fine. He will return the full login link after redirection.
For example: https://your-domain.com/custom-loginBut “$_SERVER[‘SCRIPT_NAME’]” does not work properly. It always returns “/index.php” instead of “/custom-login” even if the user is on the login page.
So the is_login() function only returns false even if the user is on the login page, which seems to be a problem that needs to be fixed.
- The topic ‘When the plugin is on, the is_login() function does not work.’ is closed to new replies.