Skip to content

PHP code snippet – How to get display name in wordpress?

	$user_info = get_userdata(1);
	echo 'Username: ' . $user_info->user_login . "\n";
	echo 'User roles: ' . implode(', ', $user_info->roles) . "\n";
	echo 'User ID: ' . $user_info->ID . "\n";
See also  Auto scroll to the end of an element in CSS

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.