Wordpress - how detect if current page is the login page

后端 未结 4 1526
生来不讨喜
生来不讨喜 2021-02-05 06:39

There is a better way than using global variable $pagenow to detect current page if is login page, like a is_admin() ?

if ($pagenow !=          


        
4条回答
  •  粉色の甜心
    2021-02-05 06:53

    While I tend to agree with others on the need for a function is_login_page() or something similar, I found what seems to be the best answer at https://wordpress.stackexchange.com/questions/12863/check-if-were-on-the-wp-login-page, which I used to make the following:

提交回复
热议问题