There's an easy method than using global variable $pagenow to identify current page if is login page, just like a is_admin() ?

if ($pagenow != 'wp-login.php' && !is_admin())
    // Do something

There's a worldwide variable $current_screen having a getter get_current_screen() (which declared in /wp-admin/includes/template.php), but it is always comparable to NULL

On #15686 (Detect the current page template tag) – WordPress Trac it's sayed it's often used $pagenow, however i think isn't the great way to check non-dynamic pages against there file title rather than there function (like admin page)

Can't you explain what exactly are you going related to it? In order to tell should you code using wordpress hooks.

or make use of the absolute uri, just match it with wordpress-login.php


echo $uri;


While I am inclined to accept others on the requirement for a function is_login_page() or something like that similar, I discovered what appears to be the greatest answer at, which I did previously result in the following:

function is_login_page() {
    return in_array($GLOBALS['pagenow'], array('wp-login.php', 'wp-register.php'));