Skip Navigation

[Gelöst] Can't get the user_role_func work on CRED form

This support ticket is created vor 4 Jahre, 10 Monate. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

This topic contains 1 Antwort, has 1 Stimme.

Last updated by jean-francoisB vor 4 Jahre, 10 Monate.

Author
Artikel
#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!!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.