Skip to content

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

<?php 
	$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  How to make a loop in Python?

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.