When it comes to building web applications, I’m a fan of letting a user use their email as their primary login – in fact, I’d go as far as to say that I wish our email was our primary identity: They are unique, it’s a single thing to remember, and we all must have them in order to get online these days.
To that end, whenever I’m working on an application that requires a username and password, I always default to using the email address for the user’s identification. Everything else can be managed in a profile setting, right?
If you’re building an application in WordPress where you’re building custom registration mechanisms through your own views, validation, and so on, you may find yourself needing to check to see if a user already exists.
And if you – like me – often use email as the user name, there’s a really easy way to perform this check.
