Skip Navigation

[Resolved] Conditional testing user role with multiple roles

This support ticket is created 4 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 1 reply, has 1 voice.

Last updated by philippeS-4 4 years, 6 months ago.

Author
Posts
#1609369

Hi there,

Using Access I have created some new roles, some users have multiple roles on which I would like to do a conditional test example:

[wpv-conditional if="( '[wpv-current-user info='role']' eq 'cn-subscriber' )"]I am a CN Subscriber[/wpv-conditional]

This works fine for the primary role but doesn't work with additional roles.

How can I make it work?

Thanks,

#1609405

Using Access to do the test was a better solution - should have thought about it!

[toolset_access role="CN Subscriber" operator="allow"]
I am a CN Subscriber
[/toolset_access]

My issue is resolved now. Thank you!