Description
This function can output any profile information for a given user. For example, to display user’s display name, role, or any other custom field with PHP.
Usage
1 2 3 4 5 6 7 |
<?php userpro_profile_data( $field, $user_id ); ?> |
Parameters
- $field – Custom field to retrieve
- $user_id – User ID (required)
Returns
Return the value of custom field stored for that user (If it exists)
Examples
Display the user’s role of admin (User ID: 1)
1 2 3 |
<?php echo userpro_profile_data('role', 1); ?> |
Display user’s display name
1 2 3 |
<?php echo userpro_profile_data('display_name', 75); ?> |
Leave A Comment?