Skip Navigation

[Resolved] Conditional Statement – Check if Author of Post is a Set Role

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 7 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 1 reply, has 2 voices.

Last updated by Beda 7 years, 11 months ago.

Assisted by: Beda.

Author
Posts
#466137

I am trying to make a conditional statement for a user Profile for a Paid Talent Site. What I need is If the Author of the Post has the WordPress Role "Talent" - I made an additional role that I copied from Subscriber. Then show The field I want to display

I tried using the program that makes statements but I have no idea what to make it equal to

[wpv-conditional if="( '[wpv-post-author]' eq ' ' )"]

So what I need is

If The Post Author is a member of Role Talent show a result. If its not a member of Talent Then it will just show an image or something.

#466210

You use the GUI for "Conditional Output" and compare either the current logged in user, or the post author, to the role of the either current logged in user, or author.

This looks at the end like this:
[wpv-conditional if="( '[wpv-current-user info='role']' eq 'your_custom_role' )"]
your conditional stuff here
[/wpv-conditional]

If you want to compare the author, it's the same, but with the author shortcode.
The issue here is the Author ShortCode can not call the User Role directly.
So you need to compare as example against the user level.

The forum ‘Types Community Support’ is closed to new topics and replies.