wpseek.com
A WordPress-centric search engine for devs and theme authors
get_user_id_from_string is deprecated since version 3.6.0!
Alternative: get_user_by()
Alternative: get_user_by()
get_user_id_from_string › WordPress Function
Since
Deprecated3.6.0
› get_user_id_from_string ( $string )
Parameters: |
|
See: | |
Returns: |
|
Defined at: |
|
Codex: | |
Change Log: |
|
Get a numeric user ID from either an email address or a login.
A numeric string is considered to be an existing user ID and is simply returned as such.Related Functions: get_user_setting, get_post_format_string, get_post_format_strings, get_user_option, set_user_setting
Source
function get_user_id_from_string( $string ) { _deprecated_function( __FUNCTION__, '3.6.0', 'get_user_by()' ); if ( is_email( $string ) ) $user = get_user_by( 'email', $string ); elseif ( is_numeric( $string ) ) return $string; else $user = get_user_by( 'login', $string ); if ( $user ) return $user->ID; return 0; }