get_role

Description

This method gets a user role in slug format. e.g. member

Usage

<?php  UM()->user()->get_role(); ?>

Returns

The user role’s slug.

Examples

Do something if the user’s role is paid-member

<?php um_fetch_user( 12 );
if ( UM()->user()->get_role() == 'paid-member' ) {
// Show this to paid customers 
} else {
// You are a free member
} ?>