Skip Navigation

[Resolved] Can't get the user_role_func work on CRED form

This support ticket is created 5 years, 5 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 jean-francoisB 5 years, 5 months ago.

Author
Posts
#1268679

Hi,

I have a website with listings. Depending of the role of the author, some fields are showed and some not. This part works fine.

I would like to replicate this function but for the CRED form when people create their listing. Depending of if they have a free, silver or gold membership, some fields are visibile, some not.

I have wraped the fields with this code :

[wpv-conditional if="( '[user_role_func]' eq 'silver_membership' ) OR ( '[user_role_func]' eq 'gold_membership' ) OR ( '[user_role_func]' eq 'free_membership' ) OR ( '[user_role_func]' eq 'administrator' )"]

[/wpv-conditional]

The condition doesn't work. With free, silver and gold membership role, we can still see all the fields.

How can I hide fields in CRED form for specific user role?

Thank you,

#1268687

I finally found on your forum this code that make it work in CRED :

[wpv-conditional if="( '[wpv-current-user info="role"]' eq 'free_membership' ) OR ( '[wpv-current-user info="role"]' eq 'silver_membership' ) OR ( '[wpv-current-user info="role"]' eq 'gold_membership' ) OR ( '[wpv-current-user info="role"]' eq 'administrator' )"]

Thank you!!