Abdessamad Idrissi
Member
Posted 1 year ago #
I want to "hijack" the wp-login.php page to make a custom login page, yes I know there's plugins that allow you to do so, but I need a more customized/independent solution; .
so far I use if ($pagenow == 'wp-login.php') but I have read that it is not recommended to use core variables inside themes/templates.
so the question is how to detect that we are in the wp-login.php page since this is a special page not just an ordinary post or page?
thanx
Abdessamad Idrissi
Member
Posted 1 year ago #
I created a feature request ticket:
#15686
Abdessamad Idrissi
Member
Posted 1 year ago #
after posting on trac, nacin posted the answer:
It's fine to reference globals. Using pagenow is quite common in fact.
That said, there's the $current_screen object, which if you prefer, has its own getter, get_current_screen(). This was introduced in 3.0 and includes much more information and context than pagenow.
thanx nacin.