Skip to content

Instantly share code, notes, and snippets.

@kfriend
Last active December 14, 2015 07:09
Show Gist options
  • Save kfriend/5048584 to your computer and use it in GitHub Desktop.
Save kfriend/5048584 to your computer and use it in GitHub Desktop.
WordPress helper for detecting if the current page is the login page
<?php
/**
* Is Login Page
*
* Detects if the current request is from the login page.
*
* Credit: http://stackoverflow.com/questions/5266945/wordpress-how-detect-if-current-page-is-the-login-page#5892694
*/
function isLoginPage()
{
return in_array($GLOBALS['pagenow'], array('wp-login.php', 'wp-register.php'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment