Solution:1
get_userdatabylogin
is now deprecated, it is possible to get the same result via
example :
$user = get_user_by('login','loginname');
if($user)
{
echo $user->ID;
}
link to the ticket about this change
Solution:1
get_userdatabylogin
is now deprecated, it is possible to get the same result via
example :
$user = get_user_by('login','loginname');
if($user)
{
echo $user->ID;
}
link to the ticket about this change
Solution:2
get_userdata()
function is an alias of get_user_by('ID')
function. Use this code:
$username = 'your user name';
$user = get_user_by('login', $username);
It will return WP_User object on success, or false on failure. See Codex.
REST API: http://example.com/wp-json/wp/v2/users/<id>