Navigation überspringen

[Gelöst] Conditional User Text Field Display

This support ticket is created vor 2 years, 4 months. 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.

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 -

Zeitzone des Unterstützers: Asia/Kolkata (GMT+05:30)

Dieses Thema enthält 1 reply, hat 2 voices.

Zuletzt aktualisiert von Minesh vor 2 years, 4 months.

Assistiert von: Minesh.

Author
Artikel
#2611211

I have a Custom User Text Field which I need to display conditionally on a page. No reference to it in the documentations though pretty sure I did this in the past.

I want to

If [types usermeta='full-member'][/types] is not empty display a message.

If [types usermeta='full-member'][/types] is empty do not display a message.

How to do? Thanks

#2611221

Minesh
Unterstützer

Sprachen: Englisch (English )

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

Hello. Thank you for contacting the Toolset support.

You can use the conditional shortcode to display the conditional content based on the custom user field.

For example:

[wpv-conditional if="( '[types usermeta='full-member' current_user='true'][/types]' eq '' )"]
 this field is empty
[/wpv-conditional]

Here is the related ticket that might help you:
- https://toolset.com/forums/topic/how-to-check-if-userfield-is-empty/

More info:
- https://toolset.com/documentation/legacy-features/views-plugin/checking-fields-and-other-elements-for-emptynon-empty-values/