Title: get_role problem
Last modified: March 5, 2020

---

# get_role problem

 *  Resolved [Ddaro](https://wordpress.org/support/users/darney/)
 * (@darney)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/get_role-problem/)
 * when I try to call functions from the documentation
    `<?php $ultimatemember->
   user->get_role(); ?>`
 * I get an error
 * Fatal error: Uncaught Error: Call to a member function get_role()
    Why can’t 
   I get the current role?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Support [Towhid](https://wordpress.org/support/users/cryptex_vinci/)
 * (@cryptex_vinci)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/get_role-problem/#post-12559155)
 * Hi [@darney](https://wordpress.org/support/users/darney/)
 * Since version 2.0+ global variable $ultimatemember is deprecated. It’s replaced
   with UM(). You can try following method:
 * `UM()->user()->get_role();`
 * Thanks
 *  Plugin Contributor [Champ Camba](https://wordpress.org/support/users/champsupertramp/)
 * (@champsupertramp)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/get_role-problem/#post-12561551)
 * Hi [@darney](https://wordpress.org/support/users/darney/)
 * Please feel free to re-open this thread if any questions may come up.
 * Regards,

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘get_role problem’ is closed to new replies.

 * ![](https://ps.w.org/ultimate-member/assets/icon-256x256.png?rev=3160947)
 * [Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin](https://wordpress.org/plugins/ultimate-member/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-member/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-member/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-member/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-member/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-member/reviews/)

## Tags

 * [get_role](https://wordpress.org/support/topic-tag/get_role/)
 * [role](https://wordpress.org/support/topic-tag/role/)

 * 2 replies
 * 3 participants
 * Last reply from: [Champ Camba](https://wordpress.org/support/users/champsupertramp/)
 * Last activity: [6 years, 2 months ago](https://wordpress.org/support/topic/get_role-problem/#post-12561551)
 * Status: resolved