Saltar navegación

[Resuelto] Showing logged in user data

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

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

Zona horaria del colaborador: Asia/Hong_Kong (GMT+08:00)

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por milanV 4 years, 3 months ago.

Asistido por: Luo Yang.

Autor
Mensajes
#2320001

Hello guys,
I'm trying to show logged in user information, like email or phone number.

I know I can show any post author data with [types usermeta='field-i-need' user_is_author='true'][/types]

Is there a similar shortcode to display logged-in user data?

Best regards
Thanks a lot !

#2320283

Hello,

If it is custom user field created with Toolset Types plugin, you can use [types] shortcode with user_current="true" attribute, for example:
[types usermeta='field-i-need' user_current='true'][/types]
https://toolset.com/documentation/customizing-sites-using-php/functions/
user_current:
"true" - output user field for the logged in user

If it is other user field, please try [wpv-user] shortcode, for example:
[wpv-user field="user_email"]
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-user
it will display information for the current logged-in user

#2320319

Best thanks Luo Yang,
That works !

Have a nice day 🙂

My issue is resolved now. Thank you!