um_user

Description

This function can be used to get user’s data. This can be user profile data or user permissions.

Usage

<?php echo um_user( $data ); ?>

Parameters

$data

(string) (required) The field or data you want to retrieve for user.

$attrs

(string) (optional) Additional attribute for profile data that may need extra configuration.

Returns

Returns the user data requested If found. A user must be previously set using um_fetch_user() to properly retrieve user data.

Examples

The example below can retrieve the user’s display name

<?php
$display_name = um_user('display_name');
echo $display_name; // prints the user's display name
?>

The example below can retrieve user’s community role

<?php echo um_user('role_name'); // example: Member or Admin ?>