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

WordPress Trac noreply at wordpress.org
Tue Dec 11 00:33:12 UTC 2012

#19898: Create a is_login() function similar to is_admin()
 Reporter:  dcowgill               |       Owner:
     Type:  enhancement            |      Status:  new
 Priority:  normal                 |   Milestone:  Future Release
Component:  Administration         |     Version:  3.3.1
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |

Comment (by nacin):

 Replying to [comment:10 scribu]:
 > Actually, we don't even need a new filter. is_login() can just compare
 wp_login_url() agains the current URL (which I really think deserves a
 get_current_url() helper, btw).

 is_admin() is frequently used to decide whether we are in the admin or not
 for purposes of, say, loading code. Allowing is_login() to be true for a
 theme page doesn't really make sense, nor does it solve that wp-login.php
 is in no man's land. It would be better to offer a login.php template
 (along with signup.php, activate.php, register.php, and probably other
 login actions) if this was about themes.

 The original use case can be solved by either checking is_ssl() or just
 using a protocol-relative URL (`//`), FWIW.

Ticket URL: <http://core.trac.wordpress.org/ticket/19898#comment:17>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list