Get User Level Name

    • 53 posts
    April 19, 2018 9:50 AM EDT

    I have to admit, I am exhausted after a long night of coding. I was hoping to post this out to the community for help so I can continue after a nap.

    So, when I want to get information about a user, I would use examples as such

    $this->viewer()->getTitle() $this->viewer()->getIdentity() $this->viewer()->getPhotoUrl()

     

    and so on - what I need is something that allows me to get the users membership level by name (not ID). I was wondering what would be the easiest way to get this information. I would HOPE it would be something like: 

    $this->viewer()->getMemberLevel()

    However, I am concerned this will end up being a 2 step process of getting the User Level ID and then grabbing the User Level Name - any help on this would be great!

     


    This post was edited by socialenginestaff at April 19, 2018 9:56 AM EDT
    • Moderator
    • 6923 posts
    April 19, 2018 9:57 AM EDT

    As you're tired, I updated your post instead of deleting it as the code was not wrapped in the code tags by using the last icon on the top row of the editor. Let me go look in one of my plugins to see how I did it if I did.

    • 53 posts
    April 19, 2018 10:06 AM EDT

    Thanks Donna, Ill make sure to do that next time!

    • 53 posts
    April 27, 2018 1:58 AM EDT

    Bump?

    • Moderator
    • 6923 posts
    April 27, 2018 5:03 AM EDT

    Sorry, I don't have an answer. I was looking in the admin panel as it shows member level and I was looking in the search as it also gets by member level. Haven't had a lot of time to explore it more than that.