get_role

Description

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

Usage

<?php $ultimatemember->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 ( $ultimatemember->user->get_role() == 'paid-member' ) {
// Show this to paid customers
} else {
// You are a free member
}
?>