Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




username_exists [ WordPress Function ]

username_exists ( $username )
Parameters:
  • (string) $username Username.
Returns:
  • (null|int) The user's ID on success, and null on failure.
Defined at:



Checks whether the given username exists.

Source


<?php
function username_exists$username ) {
    if ( 
$user get_user_by('login'$username ) ) {
        return 
$user->ID;
    } else {
        return 
null;
    }
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics