I did it! =)
Moodle 3
Follow code and the explanation:
//Need to database
global $DB;
//user_info_data, table with data of the fields
//userid, id of user
//fieldid, id of the field you wanna show
$field_value = $DB->get_record( 'user_info_data' , array( 'userid' => $userid, 'fieldid' => 1) );
//Shows the data of field
echo $field_value->data;
General developer forum
How to display the value of a custom field profile?
This discussion has been locked so you can no longer reply to it.