Skip Navigation

[Resolved] conditional block with logedin user custom field….

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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by jeanL-2 1 year, 7 months ago.

Assisted by: Minesh.

Author
Posts
#2592111

Can you please tell us what you are trying to achieve?

I am using the conditional block to display a menu, and I want it to appear only if the logged-in user has a specific custom field checked.

This is the shortcode that displays the fields that were checked during user creation: [types usermeta='roles' separator=', ' user_is_author='true'][/types].

#2592611

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Toolset conditional block you can use to compare the post custom field. To check the user custom fields, either you can switch to the [wpv-conditional] shortcode or you can enable the advance mode for conditional block and add the condition manually.

For example:

( NOT ( empty( '[wpv-current-user info="id"]') )  AND  ( '[types usermeta="roles" output="raw" current_user="true"][/types]' = 'role_value' ))

Where:
- Replace role_value with your original role value.

If above solution does not help, please share admin access details where you want to add conditional and what role value you want to compare.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2593199

My issue is resolved now. Thank you!