WordPress at a glance
function is not described

get_user_id_from_string() WP 3.0.0

Deprecated in 3.6.0. It is no longer supported and can be removed in future releases. Use get_user_by() instead.

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.

  • See: get_user_by()

No Hooks.




get_user_id_from_string( $string );
$string(string) (required)
Either an email address or a login.

Code of get user id from string: wp-includes/ms-deprecated.php WP 5.2.2

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;
		$user = get_user_by( 'login', $string );

	if ( $user )
		return $user->ID;
	return 0;