Navigation überspringen

[Gelöst] Retrieve user custom field of post author

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

Problem:

Display post's author information in editing post form.

Solution:

You can use "HTML content" element, like this:

[types usermeta='user-number' user_id='[wpv-post-author format="meta" meta="ID"]'][/types]

Relevant Documentation:

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

Zeitzone des Unterstützers: Asia/Hong_Kong (GMT+08:00)

Dieses Thema enthält 2 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von Puntorosso vor 4 Jahre, 5 Monaten.

Assistiert von: Luo Yang.

Author
Artikel
#1930569

Hi,
I use a Cred Form in a template, to update a custom post ("Inquiry"),.
Before the form, I would need to display a User Custom Field (user-number), related to the author of that custom post.
I have tried

[types usermeta='user-number' user_id='[wpv-post-author format="meta" meta="ID"]'][/types]

but it doesn't work.

#1930679
html-content.JPG

Hello,

I have tried it in my localhost (fresh WP installation + the latest version of Toolset plugins), with below steps:
1) Create a custom user field "user-number"
2) Create a user form for editing user
3) In the form content, add a "HTML content" element, with the same codes you mentioned above:

[types usermeta='user-number' user_id='[wpv-post-author format="meta" meta="ID"]'][/types]

See my screenshot html-content.JPG

It works fine in front-end, I can see correct custom user field value.

Is there any missing? please provide detail steps to reproduce the same problem, thanks

#1931627

Solved, thanks.