[wp-trac] [WordPress Trac] #19898: Create a is_login() function similar to is_admin()

WordPress Trac noreply at wordpress.org
Thu Sep 12 02:18:12 UTC 2019


#19898: Create a is_login() function similar to is_admin()
-----------------------------------+-----------------------
 Reporter:  dcowgill               |       Owner:  (none)
     Type:  enhancement            |      Status:  reopened
 Priority:  normal                 |   Milestone:  5.3
Component:  Administration         |     Version:  3.3
 Severity:  normal                 |  Resolution:
 Keywords:  2nd-opinion has-patch  |     Focuses:
-----------------------------------+-----------------------
Changes (by donmhico):

 * keywords:  needs-refresh 2nd-opinion => 2nd-opinion has-patch


Comment:

 Replying to [comment:26 iandunn]:
 > I would do this instead:
 >
 > {{{
 > function is_login_screen() {
 >       return false !== stripos( wp_login_url(), $_SERVER['SCRIPT_NAME']
 );
 > }
 > }}}

 Looks good to me too. I created a patch,
 [https://core.trac.wordpress.org/attachment/ticket/19898/19898.6.diff
 19898.6.diff ], using @iandunn's solution. I inserted the function in `wp-
 includes/load.php` as other similar functions such as `is_admin()` resides
 there,

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/19898#comment:28>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list