Check if a specific member role is logged in
-
Hi!
I really need some help here. I’ve checked https://rocketgeek.com/plugins/wp-members/docs/api-functions/ and looked at “wpmem_user_has_role()”.I have created different memberships(products) in this plugin like Gold, silver, bronze.
In admin under “memberships” I can see the slug gold I created(Product attribute).Now in my code I want to do something like:
if ( wpmem_user_has_role( ‘gold’ ) ) {
//DO STUFF <div>SHOW MY CONTENT</div>
}or
if ( wpmem_logged_in_product( ‘gold’ ) ){
//DO STUFF <div>SHOW MY CONTENT</div>
}I cant get it working??
There must be a way to check WHAT role/slug a user currently have as logged in and be able to show different content based on that. The issue here is that I want to show hide only a part of the content/div for specific users.Anybody plz help!!
- The topic ‘Check if a specific member role is logged in’ is closed to new replies.